91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫COMPUTER NETWORKS

時間:2023-12-24  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



COMPUTER NETWORKS FALL 2023
Build Your Own Router
Assigned: December 6, 2023 Due Date: 23:59, December 27, 2023
1 ASSIGNMENT
You must work on this assignment individually.
This project is designed for you to:
• Learntobuildasimplerouter.
• TobefamiliarwithIPv4,ICMPandARP.
In this project, you will be writing a simple router with a static routing table. Your router will receive raw Ethernet frames and process them just like a real router: forward them to the correct outgoing interface, create new frames, etc. The starter code will provide the framework to receive Ethernet frames; your job is to create the forwarding logic.
You are allowed to use some high-level abstractions, including C++11 extensions, for parts that are not directly related to networking, such as string parsing, multi-threading, etc.
In the following contents, you will see
• DetaileddescriptionofthisporjectinSection2
• GuidelinestosetuptheenvironmentinSection3 • OverviewofthestartercodeinSection4
• SomehelpfulhintsinSections5
• HowtosubmityourcodeinSection6
• GradingcriteriainSection7
This assignment is considerably hard, so get started early, not as some of you did for FTP Project, to avoid missing the deadline.
  1

2 PROJECT DESCRIPTION
There are four main parts in this assignment:
• HandleEthernetframes • HandleARPpackets
• HandleIPv4packets
• HandleICMPpackets
This assignment runs on top of Mininet which was built at Stanford. Mininet allows you to emulate a network topology on a single machine. It provides the needed isolation between the emulated nodes so that your router node can process and forward real Ethernet frames between the hosts like a real router. You don’t have to know how Mininet works to complete this assignment, but if you’re curious, you can learn more information about Mininet on its official website (http://mininet.org/).
Your router will route real packets between emulated hosts in a single-router topology. The project envi- ronment and the starter code has the following default topology:
  +−−−−−−−−−−−−−−−−+ server1−eth0
| 192.168.2.2/24 + +−−−−−−−−−−−+
 192.168.2.1/24 | sw0−eth1 | +−−−−−−−−−−+ +−−−−−−−−−−−−−−−−−−+ |
| server1 | |
| |
| client |
| | | (sw0) |
| | +−−−−−−−−−−−+ | SimpleRouter |
 +−−−−−−−−−−+ client −eth0
| |
+−−−−−−−−−−−−−−−−−−+ +−−−−−−−−−−−+
10.0.1.100/8 +
sw0−eth3 sw0−eth2 10.0.1.1/8 172.64.3.1/16
| |
| server2 | |++||
 | | | +−−−−−−−−−−−+ | | | server2−eth0
+−−−−−−−−−−−−−−−−−−−−−−+ +−−−−−−−−−−−−−−−−+ 172.64.3.10/16
     The corresponding routing table for the SimpleRouter sw0 in this default topology:
NOTE: DonothardcodeanyIPaddresses,network,orinterfaceinformation.Wewillbetestingyour code on other single-router topologies with different number of servers and clients, and different IP and network addresses. So it is STRONGLY RECOMMENDED that you test your implementations under dif- ferentIPaddressesandroutingtables(bymodifyingthe IP_CONFIG and RTABLE filerespectively).
If your router is functioning correctly, all of the following operations should work:
   Destination Gateway Mask Iface −−−−−−−−−−−− −−−−−−−−−−−− −−−−−−−−−−−−−−−− −−−−−−−−
 0.0.0.0 192.168.2.2 172.64.3.10
10.0.1.100 0.0.0.0 0.0.0.0 255.255.255.0 0.0.0.0 255.255.0.0
sw0−eth3 sw0−eth1 sw0−eth2
      2


ping fromtheclienttoanyoftherouter’sinterfaces:
  mininet> client ping 192.168.2.1
 ...
mininet> client ping 172.64.3.1
...
mininet> client ping 10.0.1.1
...
     •



ping fromtheclienttoanyoftheappservers:
from the client to any of the router’s interfaces:
from the client to any of the app servers:
Downloadingfilesfromhttp-serverby wget command
2.1 ETHERNET FRAMES
  mininet> client ping server1 # or client ping 192.168.2.2 ...
mininet> client ping server2 # or client ping 172.64.3.10
 ...
      traceroute
  mininet> client traceroute 192.168.2.1 ...
mininet> client traceroute 172.64.3.1
 ...
mininet> client traceroute 10.0.1.1
...
      traceroute
  mininet> client traceroute server1
 ...
mininet> client traceroute server2
...
        mininet> client wget http://192.168.2.2/<filename>
 ...
mininet> client wget http://172.64.3.10/<filename>
...
    A data packet on a physical Ethernet link is called an Ethernet packet, which transports an Ethernet frame as its payload.
The starter code will provide you with a raw Ethernet frame. Your implementation should understand source and destination MAC addresses and properly dispatch the frame based on the protocol.
   0123 012345678**12345678**12345678**1 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
| Destination Address | + (48 bits ) +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
3

 | | Source Address | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ (48 bits ) + || +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Type (16 bits) | |
 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ + || || ~ Payload ~ || ||
 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
    Note that actual Ethernet frame also includes a **-bit Cyclical Redundancy Check (CRC). In this project, you will not need it, as it will be added automatically.
• Type : Payload types – 0x0806 (ARP)
– 0x0800 (IPv4)
For your convenience, the starter code defines Ethernet header as an   structure in   :
Requirements
• YourroutershouldignoreEthernetframesotherthanARPandIPv4.
• Your router must ignore Ethernet frames not destined to the router, i.e., when destination hard- ware address is neither the corresponding MAC address of the interface nor a broadcast address ( FF:FF:FF:FF:FF:FF ).
• Your router must appropriately dispatch Ethernet frames (their payload) carrying ARP and IPv4 packets.
2.2 ARP PACKETS
The Address Resolution Protocol (ARP) (RFC 826) is a telecommunication protocol used for resolution of Internet layer addresses (e.g., IPv4) into link layer addresses (e.g., Ethernet). In particular, before your router can forward an IP packet to the next-hop specified in the routing table, it needs to use ARP re- quest/reply to discover a MAC address of the next-hop. Similarly, other hosts in the network need to use ARP request/replies in order to send IP packets to your router.
Note that ARP requests are sent to the broadcast MAC address ( FF:FF:FF:FF:FF:FF ). ARP replies are sent directly to the requester’s MAC address.
  ethernet_hdr
core/protocol.hpp
  struct ethernet_hdr {
uint8_t ether_dhost[ETHER_ADDR_LEN]; /* destination ethernet address */
 uint8_t ether_shost[ETHER_ADDR_LEN]; /* source ethernet address */
uint16_t ether_type ; /* packet type ID */ } __attribute__ ((packed)) ;
         4

 0123 012345678**12345678**12345678**1 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
| Hardware Type | Protocol Type | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
 | HW addr len | Prot addr len | Opcode | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ || ~ Source hardware address ~ || +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
 || ~ Source protocol address ~ || +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ ||
 ~ Destination hardware address ~ || +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ || ~ Destination protocol address ~ ||
 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
      • Hardware Type : 0x0001 (Ethernet)
• Protocol Type : 0x0800 (IPv4)
• Opcode :
– 1 (ARP request)
– 2 (ARP reply)
• HW addr len : number of octets in the specified hardware address. Ethernet has 6-octet addresses,
so 0x06.
• Prot addr len : number of octets in the requested network address. IPv4 has 4-octet addresses, so 0x04.
For your convenience, the starter code defines the ARP header as an   structure in   :
     struct arp_hdr
arp_hdr
core/protocol.hpp
   {
unsigned unsigned unsigned unsigned unsigned
short short char char short
arp_hrd ; arp_pro ; arp_hln ; arp_pln ; arp_op ;
/* format of hardware address */ /* format of protocol address */ /* length of hardware address */ /* length of protocol address */ /* ARP opcode (command) */
 unsigned char
uint**_t
unsigned char
arp_sha[ETHER_ADDR_LEN]; /* sender hardware address arp_sip ; / * sender IP address arp_tha[ETHER_ADDR_LEN]; /* target hardware address arp_tip ; /* target IP address
*/ * / */ */
uint**_t
} __attribute__ ((packed)) ;
 5

    Requirements
• YourroutermustproperlyprocessincomingARPrequestsandreplies:
– MustproperlyrespondtoARPrequestsforMACaddressfortheIPaddressofthecorrespond- ing network interface
– MustignoreotherARPrequests
• When your router receives an IP packet to be forwarded to a next-hop IP address, it should check
ARP cache if it contains the corresponding MAC address:
– Ifavalidentryfound,theroutershouldproceedwithhandlingtheIPpacket
– Otherwise,theroutershouldqueuethereceivedpacketandstartsendingARPrequesttodis- cover the IP-MAC mapping.
• When router receives an ARP reply, it should record IP-MAC mapping information in ARP cache (Source IP/Source hardware address in the ARP reply). Afterwards, the router should send out all corresponding enqueued packets.
NOTE: Your implementation should not save IP-MAC mapping based on any other messages, only from ARP replies!
• ToreducestalenessoftheARPinformation,entriesinARPcacheshouldtimeoutafter 30seconds. Thestartercode(ArpCache class)alreadyincludesthefacilitytomarkARPentries“invalid”.Your task is to remove such entries. If there is an ongoing traffic (e.g., client still pinging the server), then the router should go through the standard mechanism to send ARP request and then cache the response. If there is no ongoing traffic, then ARP cache should eventually become empty.
• TheroutershouldsendanARPrequestaboutonceaseconduntilanARPreplycomesbackorthe requesthasbeensentoutatleast 5times.
If your router didn’t receive ARP reply after re-transmitting an ARP request 5 times, it should stop re-transmitting, remove the pending request, and any packets that are queued for the transmission that are associated with the request.
YourroutershouldalsosendanICMPDestination HostUnreachable messagetothesourceIP.
2.3 IPV4 PACKETS
Internet Protocol version 4 (IPv4) (RFC 791) is the dominant communication protocol for relaying data- grams across network boundaries. Its routing function enables internetworking, and essentially estab- lishes the Internet. IP has the task of delivering packets from the source host to the destination host solely based on the IP addresses in the packet headers. For this purpose, IP defines packet structures that encapsulate the data to be delivered. It also defines addressing methods that are used to label the datagram with source and destination information.
       0123 012345678**12345678**12345678**1 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
 | Version | IHL | Type of Service | Total Length | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
6

 | Identification | Flags | Fragment Offset | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Time to Live | Protocol | Header Checksum | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Source Address |
 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Destination Address | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Options | Padding | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ ||
 || ~ Payload ~ || || +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
    For your convenience, the starter code defines the IPv4 header as an   structure in :
 uint8_t uint16_t
ip_tos ; ip_len ;
*/
service */
ip_hdr
core/protocol.hpp
  struct ip_hdr {
unsigned int ip_hl :4; unsigned int ip_v :4;
/* header
/* version
/* type of
/* total length */
length */
 uint16_t uint16_t
uint8_t
uint8_t
uint16_t ip_sum;
/* identification */
/* fragment offset field */ /* time to live */
/* protocol */
/* checksum * /
ip_id ;
ip_off ; ip_ttl ; ip_p ;
 uint**_t ip_src , ip_dst ; /* source and dest address */ } __attribute__ ((packed));
     Requirements
• ForeachincomingIPv4packet,yourroutershouldverifyitschecksumandtheminimumlengthof an IP packet
– Invalidpacketsmustbediscarded.
• Your router should classify datagrams into (1) destined to the router (to one of the IP addresses of
the router), and (2) datagrams to be forwarded:
– For(1),ifpacketcarriesICMPpayload,itshouldbeproperlydispatched.Otherwise,discarded (a proper ICMP error response is NOT required for this project).
– For (2), your router should use the longest prefix match algorithm to find a next-hop IP ad- dress in the routing table and attempt to forward it there
• For each forwarded IPv4 packet, your router should correctly decrement TTL and recompute the checksum.
7

2.4 ICMP PACKETS
Internet Control Message Protocol (ICMP) (RFC 792) is a simple protocol that can send control informa- tion to a host.
In this assignment, your router will use ICMP to send messages back to a sending host. • Echo or   message
Echo Reply
  0123
012345678**12345678**12345678**1 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Type | Code = 0 | Checksum | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
| Identifier | Sequence Number |
 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Data ...
+−+−+−+−+−
     – Type
* *
8 : echo message
0 : echo reply message
message
 Time Exceeded
  0123
012345678**12345678**12345678**1 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Type=11 | Code | Checksum | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
 | unused | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Internet Header + 64 bits of Original Data Datagram | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
  •
   – Code
* *
0 : time to live exceeded in transit
1 : fragment reassembly time exceeded (NOT required to implement)
message
 Destination Unreachable
  0123
012345678**12345678**12345678**1 +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
 | Type=3 | Code | Checksum | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | unused | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+ | Internet Header + 64 bits of Original Data Datagram | +−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+−+
  •
   8

– Code
* 1 : Destination host unreachable
* 3 : Destination port unreachable
When an ICMP message is composed by a router, the source address field of the internet header can be the IP address of any of the router’s interfaces, as specified in RFC 792.
Notethat TimeExceeded messageisneededfor traceroute toworkproperly.
For your convenience, the starter code defines the ICMP header as an structure in :
You may want to create additional structs for ICMP messages, but make sure to use the packed attribute so that the compiler doesn’t try to align the fields in the struct to word boundaries (i.e., must use
__attribute__((packed)) annotation).
Requirements
Your router should properly generate the following ICMP messages, including proper ICMP header check- sums:
    icmp_hdr
core/protocol.hpp
  struct icmp_hdr { uint8_t icmp_type ; uint8_t icmp_code;
 uint16_t icmp_sum;
} __attribute__ ((packed));
        •


Echo Reply message ( type 0 ):
Sent in response to an incoming Echo Request message (ping) to one of the router’s interfaces.
Echo requests sent to other IP addresses should be forwarded to the next hop address as usual. Inthisproject, EchoReply message’sinitialTTLfieldinitsIPv4headershouldbe 64.
Time Exceeded message ( type 11 , code 0 ):
Sent if an IP packet is discarded during processing because the TTL field is 0. This is needed for
traceroute to work.
Port Unreachable message ( type 3 , code 3 ):
Sent if an IP packet containing a UDP or TCP payload is sent to one of the router’s interfaces. This is needed for traceroute to work.
3 ENVIRONMENT SETUP
        You are suggested to finish this project on Ubuntu 16.04.7. If your system is Windows or Mac OS, you can install Ubuntu 16.04.7 Virtual Machine in VMware. (Do not use Windows Subsystem for Linux (WSL), as Mininet is currently not supported by WSL.)
We provide   to setup the environment. Please run it in superuser mode:
setup.sh
   sudo bash setup.sh
    9

To run or test your code, please change work path to the project directory and open three terminals here, then
1. inthefirstterminal,startpox
/opt/pox/pox . py −−verbose ucla_cs118
2. inthesecondterminal,startMininet chmod +x run.py
sudo ./run.py
To exit Mininet, type exit command in this terminal.
3. inthethirdterminal,startyourrouter
Besides,youcanusethe show-arp.py scripttoprintoutyourrouter’scurrentarpcacheorroutingtable in another terminal.
• Toshowarpcahce,run:
./show−arp.py arp
• Toshowroutingtable,run:
./show−arp.py routing
Here are some tips:
• DONOTCOPYdirectlyfromtheprojectspec,asthepdfformattingmaybeproblematic.
• Ifyougetthefollowingoutputsafterrunningrouter
or
Please restart Mininet.
• Ifyougetthefollowingoutputsafterrunning
Maybe converting the format of   is helpful
                  make
./ router
                      Got packet of size 42 on interface sw0−eth1
 Received packet, but interface is unknown, ignoring
       Resetting SimpleRouter with 0 ports
 Interface l i s t empty
     run.py
   /usr/bin/env: ’python\r ’ : No such file or directory
    run.py
   sudo apt−get install dos2unix dos2unix run.py
    10

• •
When POX controller is restrated, the simpler router needs to be manually stopped and started again.
Ifyougetthefollowingoutputsafterrunning   or
Try cleaning up mininet related environments by
sudo mn −c
4 STARTER CODE OVERVIEW is the overal structure of the starter code:
           Here
  simple−router .hpp
+−−−−−−−−−−−−−−+ core/protocol .hpp
||
| SimpleRouter | core/ utils .hpp
 || +−−−+−−−−−+−−−−+
m_arp 1 | 1| | 1 m_ifaces +−−−−−−−−−−−−−−−−+ | +−−−−−−−−−−−−−−−−−−+ |||
 | | m_routingTable | |||
|1 |1 | N (std::set)
vvv +−−−−−−+−−−−−+ +−−−−−−+−−−−−−−+ +−−−−−+−−−−−+ ||||||
 | ArpCache | | RoutingTable | | Interface | |||||| +−−−−−−−−−−−−+ +−−−−−−−−−−−−−−+ +−−−−−−−−−−−+
arp−cache.hpp routing−table .hpp core/interface .hpp
      •


SimpleRouter
Mainclassforyoursimplerouter,encapsulating ArpCache, RoutingTable,andassetof Interface
objects.
Interface
Class containing information about router’s interface, including router interface name ( name ),
hardware address ( addr ), and IPv4 address ( ip ).
RoutingTable ( routing-table.hpp|cpp )
Class implementing a simple routing table for your router. The content is automatically loaded
fromatextfilewithdefaultfilenameis RTABLE (namecanbechangedusing RoutingTable option in router.config configfile)
            •
ArpCache ( arp-cache.hpp|cpp )
Exception : Error creating interface . . . RTNETLINK answers : File exists
run.py
autograde.py
    11

  •


Method to send raw Ethernet frames (
Method to handle ARP cache events (
Method to lookup entry in the routing table (
):
Class for handling ARP entries and pending ARP requests.
4.1 KEY METHODS
Your router receives a raw Ethernet frame and sends raw Ethernet frames when sending a reply to the sending host or forwarding the frame to the next hop. The basic functions to handle these functions are:

Method that receives a raw Ethernet frame (
):
Need to implement
   Implemented
simple-router.hpp|cpp
  /**
* This method is called each time the router receives a packet on
 * the interface. The packet buffer \p packet and the receiving
* interface \p inIface are passed in as parameters.
*/
void
SimpleRouter::handlePacket(const Buffer& packet, const std::string& inIface);
    simple-router.hpp|cpp
  /**
  * Call this method to send packet \p packt from the router on
* interface \p outIface
*/
void
SimpleRouter::sendPacket(const Buffer& packet, const std::string& outIface);
      Need to implement
arp-cache.hpp|cpp
):
   /**
* This method gets called every second. For each request sent out,
* you should keep checking whether to resend a request or remove it.
*/
void
ArpCache : : periodicCheckArpRequestsAndCacheEntries ( ) ;
      Need to implement
routing-table.hpp|cpp
):
   /**
* This method should lookup a proper entry in the routing table
* using " longest −prefix match" algorithm
*/
RoutingTableEntry
RoutingTable : : lookup ( uint**_t ip ) const ;
    4.2 DEBUGGING FUNCTIONS
  We have provided you with some basic debugging functions in core/utils.hpp ( core/utils.cpp ). Feel free to use them to print out network header information from your packets. Below are some functions you may find useful:
12

  •


print_hdrs(const uint8_t *buf, uint**_t length) , print_hdrs(const Buffer& packet) Print out all possible headers starting from the Ethernet header in the packet
ipToString(uint**_t ip) , ipToString(const in_addr& address)
Print out a formatted IP address from a uint**_t or in_addr . Make sure you are passing the IP
address in the correct byte ordering
macToString(const Buffer& macAddr) PrintoutaformattedMACaddressfroma Buffer ofMACaddress
4.3 LOGGING PACKETS
      You can use Mininet to monitor traffic that goes in and out of the emulated nodes, i.e., router, server1 and server2. For example, to see the packets in and out of server1 node, use the following command in Mininet command-line interface (CLI):
mininet> server1 sudo tcpdump −n −i server1−eth0
Alternatively, you can bring up a terminal inside server1 using the following command
           mininet> xterm server1
then inside the newly opened   :
     $ sudo tcpdump −n −i server1−eth0
xterm
      4.4 GRADING SCRIPT
 Toeasedebugging,wemakeasimplifiedversionofgradingscriptpublicwith autograde.py.Itcontains all the public test cases (details in Section 7), which make up 45/85 of the total test score. To run the script, first start pox and your router, then use the following command:
chmod +x autograde.py sudo . / autograde . py
The grading result and related information will be shown in standard output as well as the details.log file. You can also change the logging level to see more detailed information:
log . setLevel ( logging .DEBUG)
If you get the following outputs from router:
Just turn off your router, grading script, and then start and exit Mininet with run.py . Afterwards, the grading script may work as expected.
                  Got packet of size 42 on interface sw0−eth1 Received packet, but interface is unknown, ignoring
     13

Notice that the private, comprehensive grading script will be run on other single-router topology with different interfaces, IP/MAC addresses. Thus, the output of provided script may be different from your final score, even on public test cases.
5 HELPFUL HINTS
Given a raw Ethernet frame, if the frame contains an IP packet that is not destined towards one of our interfaces:
• Sanity-checkthepacket(meetsminimumlengthandhascorrectchecksum).
• DecrementtheTTLby1,andrecomputethepacketchecksumoverthemodifiedheader.
• Find out which entry in the routing table has the longest prefix match with the destination IP ad- dress.
• Check the ARP cache for the next-hop MAC address corresponding to the next-hop IP. If it’s there, send it. Otherwise, send an ARP request for the next-hop IP (if one hasn’t been sent within the last second), and add the packet to the queue of packets waiting on this ARP request.
If an incoming IP packet is destined towards one of your router’s IP addresses, you should take the fol- lowing actions, consistent with the section on protocols above:
• If the packet is an ICMP echo request and its checksum is valid, send an ICMP echo reply to the sending host.
• IfthepacketcontainsaTCPorUDPpayload,sendanICMPportunreachabletothesendinghost. Otherwise, ignore the packet. Packets destined elsewhere should be forwarded using your normal forwarding logic.
Obviously, this is a very simplified version of the forwarding process, and the low-level details follow. For example, if an error occurs in any of the above steps, you will have to send an ICMP message back to the sender notifying them of an error. You may also get an ARP request or reply, which has to interact with the ARP cache correctly.
In case you have difficulties, you can contact the TAs by email: zgxw18@gmail.com,ycdfwzy@outlook.com or visit the TAs at 1**211, East Main Building.
6 SUBMISSION REQUIREMENTS
To submit your project, you need to prepare:
1. A report.pdf filenomorethanTHREEpages.(Seedetailsinsection7)
2. Allyoursourcecode, Makefile and report.pdf asa .tar.gz archive(andanyfilesfromextracredit part).
To create the submission, use the provided Makefile in the starter code. Just update Makefile to include your student ID and then just type
make tarball
           14

Then submit the resulting archive to WEB LEARNING. Before submission, please make sure:
• • •
Yourcodecompiles Yourimplementationconformstothespecification
.tar.gz archivedoesnotcontaintemporaryorotherunnecessaryfiles.Wewillautomaticallydeduct points otherwise.
7 GRADING GUIDELINES
  Yourprojectwillbegradedbasedonthefollowingparts(privatetestsarenotprovidedin autograde.py): 1. Pingtests
a) (5 pts, public) Pings from client to all other hosts (all pings expected to succeed), including non-existing host (error expected)
b) (5 pts, public) Pings from server1 to all other hosts (all pings expected to succeed), including non-existing host (error expected)
c) (5 pts, public) Pings from server2 to all other hosts (all pings expected to succeed), including non-existing host (error expected)
d) (10pts,private)Pingresponses(fromclient)haveproperTTLs
e) (5pts,public)Pingbetweenselectedhosts,checkARPcache,thereshouldbeapropernum- ber of entries
f) (5pts,public)Pingfromclienttoserver1,after40seconds,theARPcacheshouldbeempty(+ no segfaults)
g) (5 pts, private) Ping from client a non-existing IP, router sends proper ARP requests (+ no segfaults)
h) (5pts,private)Pingfromclient,receivehostunreachablemessage
2. Traceroutetests
a) (5pts,public)Traceroutefromclienttoallotherhosts,includinganon-existinghost b) (5pts,public)Traceroutefromserver1toallotherhosts,includinganon-existinghost c) (5pts,public)Traceroutefromserver2toallotherhosts,includinganon-existinghost
d) (10pts,private)Traceroutefromclienttorouter’sinterfaces(get1line) 3. Filedownloadingtests
a) (5pts,public)Downloadasmallfile(≈1KB)fromanyserverthroughhttp
b) (10pts,private)Downloadalargefile(≈10MB)fromanyserverthroughhttp 4. (20pts)CodequalityandProjectReport(report.pdf)
 15

The project report could include:
a) YournameandstudentID
b) Theproblemsyouhavemetinthisprojectandhowyousolvedthem.
c) Listofanyadditionallibrariesused. d) Anyadviceonthisproject.
Note that poor design, code structure, or report will probably reduce the credits you gained in this part.
Suppose you get A credits according to the above criteria, your final grade should be

請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機打開當(dāng)前頁
  • 上一篇:代寫公式指標 代做選股公式 請人做股標指標
  • 下一篇:莆田鞋在哪個平臺買,推薦8個購買平臺
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    亚洲人被黑人高潮完整版| 欧美大度的电影原声| 中文字幕一区二区三区在线观看| 国产风韵犹存在线视精品| 久久亚洲二区| 亚洲成人av一区二区三区| 国内一区二区在线视频观看| 亚洲精品在线观| 成人avav在线| 欧美成人在线直播| 成人午夜在线视频| 日韩午夜在线影院| 粉嫩在线一区二区三区视频| 欧美老肥妇做.爰bbww视频| 日本美女一区二区三区| 久久国产66| 亚洲图片一区二区| 亚洲综合日本| 婷婷中文字幕一区三区| 久久久噜噜噜| 久久精品二区亚洲w码| 欧美三级三级三级| 国产裸体歌舞团一区二区| 欧美人与禽zozo性伦| 国产专区欧美精品| 欧美一区欧美二区| 成人av综合一区| 久久女同性恋中文字幕| 欧美久久九九| 国产精品高潮呻吟久久| 最新国产乱人伦偷精品免费网站| 亚洲男人的天堂在线aⅴ视频| 亚洲福利免费| 亚洲成人资源网| 欧美色图片你懂的| 福利视频网站一区二区三区| 精品久久99ma| 欧美性大战久久久久| 亚洲精品福利视频网站| 噜噜噜久久亚洲精品国产品小说| 五月婷婷综合激情| 欧美群妇大交群中文字幕| 国产精品12区| 日本一区二区三区视频视频| 一本色道久久综合亚洲精品高清 | 久99久精品视频免费观看| 91麻豆精品国产91久久久使用方法| 国产成人鲁色资源国产91色综| 26uuu久久综合| 在线欧美不卡| 日本aⅴ亚洲精品中文乱码| 日韩视频123| 激情视频一区| 奇米影视一区二区三区| 欧美成人在线直播| 在线看无码的免费网站| 免费成人在线播放| 精品99999| 国产乱码精品| 国产高清亚洲一区| 国产精品久99| 欧美性xxxxxx少妇| 91亚洲精品久久久蜜桃网站 | 国产成人高清在线| 中文字幕一区二区三区视频| 色偷偷88欧美精品久久久| 国产激情91久久精品导航| 中文字幕一区日韩精品欧美| 色婷婷精品大在线视频| av在线播放不卡| 亚洲大片免费看| 久久影院午夜论| 久久亚洲精品伦理| 99精品欧美一区二区蜜桃免费| 一区二区三区国产精华| 91精品国产高清一区二区三区蜜臀 | 成人精品一区二区三区中文字幕| 亚洲免费观看高清完整版在线| 欧美片网站yy| 国产视频一区在线观看一区免费| 国产精品18久久久久久久网站| 亚洲色欲色欲www| 欧美一区二区三区在| 99热免费精品| av在线一区二区三区| 日韩精品三区四区| 国产精品嫩草99a| 欧美一区二区三区公司| 亚洲影音一区| 国语精品一区| 成人久久18免费网站麻豆| 五月婷婷久久综合| 国产精品久久久久久久蜜臀| 欧美剧在线免费观看网站| 国产欧美日韩伦理| 欧美一区影院| 国产成人免费高清| 免费看黄色91| 亚洲综合在线观看视频| 欧美激情综合五月色丁香| 91麻豆精品国产| 色狠狠av一区二区三区| 亚洲人www| 国产精品第十页| caoporn国产精品| 国产精品伊人色| 日韩av成人高清| 亚洲国产毛片aaaaa无费看| 中文乱码免费一区二区| 日韩一区二区三区视频在线观看| 日本精品裸体写真集在线观看| 亚洲精品在线视频观看| 91小视频在线免费看| 顶级嫩模精品视频在线看| 久久精品久久久精品美女| 亚洲bt欧美bt精品777| 亚洲色图欧洲色图| 国产精品免费网站在线观看| 国产亚洲综合性久久久影院| 欧美一区二区三区啪啪| 日本亚洲视频在线| 国产欧美综合在线观看第十页| 日本韩国欧美国产| 性色一区二区| 亚洲欧美成人| 一区二区三区久久网| 亚洲一级一区| 在线欧美视频| 91久久国产自产拍夜夜嗨| 欧美午夜视频| 狠狠久久综合婷婷不卡| 欧美日韩国产综合网| 99久久er热在这里只有精品66| 粉嫩嫩av羞羞动漫久久久| 国产精品系列在线观看| 国产久卡久卡久卡久卡视频精品| 久久精品国产99国产精品| 蜜桃视频免费观看一区| 国内精品亚洲| 你懂的国产精品| 欧美日韩精品伦理作品在线免费观看| hitomi一区二区三区精品| 日本韩国欧美一区| 日本韩国一区二区三区视频| 日本韩国欧美一区| 欧美巨大另类极品videosbest | 日韩一区二区三区av| 日韩精品一区二区三区老鸭窝| 日韩欧美你懂的| 久久久久久久综合| 国产蜜臀av在线一区二区三区| 中文字幕第一区综合| 国产精品二三区| 亚洲尤物视频在线| 舔着乳尖日韩一区| 老鸭窝一区二区久久精品| 韩国一区二区三区| 成人午夜电影小说| 欧美精品观看| 亚洲无线观看| 亚洲激情成人在线| 亚洲午夜久久久久久久久电影院| 亚洲一区二区精品视频| 日本va欧美va欧美va精品| 激情偷乱视频一区二区三区| 成人国产精品视频| 国产精品国色综合久久| 亚洲尤物影院| 欧美精品一卡二卡| 欧美国产日韩精品免费观看| 亚洲精品成人天堂一二三| 首页综合国产亚洲丝袜| 国产一区二区免费在线| 91美女精品福利| 国产欧美日韩一区二区三区在线 | 激情综合自拍| 色狠狠桃花综合| 2023国产精华国产精品| 一区二区理论电影在线观看| 另类小说图片综合网| 99久久综合狠狠综合久久| 亚洲免费久久| 91精品国产麻豆| 自拍偷拍亚洲激情| 韩国成人精品a∨在线观看| 91麻豆国产福利在线观看| 在线亚洲观看| 日韩视频123| 亚洲一区免费观看| 久久精品国产第一区二区三区最新章节 | 99精品国产99久久久久久福利| 欧美婷婷六月丁香综合色| 国产亚洲成aⅴ人片在线观看 | 国模精品娜娜一二三区| 色狠狠色噜噜噜综合网| 欧美国产一区视频在线观看| 日韩精品一级二级| 欧美在线视屏| 欧美性淫爽ww久久久久无| 国产精品久久久久久久久图文区|