1 / 22

PA3: Router

PA3: Router. Junxian (Jim) Huang hjx@eecs.umich.edu EECS 489 W11 http://www.eecs.umich.edu/courses/eecs489/w11/. Building your own Internet Router. Recap lectures … What is router? What does router do?. Goal of PA3.

olga-marsh
Télécharger la présentation

PA3: Router

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PA3: Router Junxian (Jim) Huang hjx@eecs.umich.edu EECS 489 W11 http://www.eecs.umich.edu/courses/eecs489/w11/

  2. Building your own Internet Router • Recap lectures … • What is router? • What does router do?

  3. Goal of PA3 • Implement a fully functional Internet router that routes real network traffic • Hands-on experience on how a router really works • Your router will run as a user process locally • Route real packets flowing across the Internet to application servers at Stanford • A skeleton, incomplete router (the “sr” or simple router) is given to complete • Demonstrate that it works by • traceroutes, pings and downloading some files from a web server via your router

  4. Overview of the Virtual Network System (VNS) • VNS server • @ Stanford • VNS clients • Your router is one

  5. VNS Server • A user level process @ Stanford • Host machine connected to two applications servers via a hub • Simulates a network topology (multiple links and VNS Clients) • Application servers sit on the other side of the network topology

  6. VNS Server example: 1 router + 1 server

  7. A Unique Topology You Will Get

  8. Routing Table • Router finds the "most specific match” • The network with the longest subnet mask that matches the destination IP address wins • 0.0.0.0/0 default route • A route lookup that doesn't match anything will naturally fall back onto this route

  9. VNS Server Example • A client connects to the server via a normal TCP socket • The client requests the traffic seen on links in the topology • The server accepts the request and sends the traffic on the link to the client over the TCP socket • The client would then inspect the packet, determine where the next hop in the network and send the packet back to the server • The server inject the packet back into the network. • The VNS Server can handle multiple (2^16) topologies simultaneously • Each student have his or her own topology to connect to and route over • The VNS Server ensures that clients are only sent traffic belonging to their topology.

  10. VNS Client

  11. VNS Client: Step by Step • Nick runs his router from his laptop

  12. VNS Client: Step by Step 1 • Nick opens his browser and type in the IP of the application server of his topology XXX • A SYN packet leaves Nick’s machine destined to the web server’s IP and is routed to the VNS server • Server decides to deliver the packet to topology XXX, starting with the IP address of eth0 on Nick’s client • The hop before Nick’s router sends an ARP packet requesting the hardware address of the interface with IP of eth0 on Nick’s client

  13. VNS Client: Step by Step 2 • The VNS Server sends the raw Ethernet, ARP packet over the socket to Nick’s VNS Client which responds with an ARP reply • On receipt of the ARP reply, the hop before Nick’s router, then forwards the packet to the Nick’s router • The VNS Server intercepts the packet and sends the raw Ethernet IP packet over the socket to Nick’s VNS Client for his to route • Nick’s router decrements the TTL field in the IP header and recalculates the checksum • Nick’s router consults its routing table and determines the next hop is the IP for the web server

  14. VNS Client: Step by Step 3 • When Nick’s router has made its routing decision, it must send back to the VNS Server a properly formatted Ethernet packet • This means that the client must find the Ethernet address of the next hop • To do this, the client sends an ARP, in the usual way, to find out the Ethernet address belonging to the next hop IP address • The next hop, which could be another client or an application server, responds to the ARP, and Nick’s client completes the Ethernet packet and sends it back to the VNS server. (The client also caches the ARP reply for future use) • The VNS Server sends the packet out of the correct interface, and to the next hop in the topology • .…. etc.

  15. Required Functionality • Route packets between the firewall and the application servers • Handle ARP requests and replies • Handles traceroutes through it and to it • Responds to ICMP echo requests • Handles TCP/UDP packets sent to one of its interfaces (ICMP port unreachable) • Maintains an ARP cache whose entries are invalidated after a timeout period

  16. Required Functionality • The router queues all packets waiting for outstanding ARP replies • If a host does not respond to 5 ARP requests, the queued packet is dropped and an ICMP host unreachable message is sent back to the source of the queued packet • The router does not needlessly drop packets • E.g. when waiting for an ARP reply • The router enforces guarantees on timeouts • If an ARP request is not responded to within a fixed period of time, the ICMP host unreachable message is generated even if no more packets arrive at the router

  17. What to Submit? • The source code for your router. You may add files to those provided with the stub code; be sure to update your Makefile if you do • Your README file describing design decisions that you made, and any trade offs that you encountered in the design.

More Related