EEC484584 Computer Networks Lecture 10 Wenbing Zhao wenbingzgmail
EEC-484/584 Computer Networks Lecture 10 Wenbing Zhao wenbingz@gmail. com (Part of the slides are based on Drs. Kurose & Ross’s slides for their Computer Networking book)
Outline n n n Distance vector routing Hierarchical routing Internet protocol q Header q Fragmentation 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing n n Also called Bellman-Ford or Ford-Fulkerson Each router maintains a table, giving best known distance to each destination and which line to use to get there q q Table is updated by exchanging info with neighbors Table contains one entry for each router in network with n n q Preferred outgoing line to that destination Estimate of time or distance to that destination Once every T msec, router sends to each neighbor a list of estimated delays to each destination and receives same from those neighbors 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing: How each entry is updated A d(A, Y) Y d(Y, Z) d(A, X) X At router A, for Z Compute d(A, X) + d(X, Z) and d(A, Y) + d(Y, Z), take minimum d(X, Z) Z d(A, Z) = min {d(A, v) + d(v, Z) } where min is taken over all neighbors v of A 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
from x 0 2 7 y ∞∞ ∞ z ∞∞ ∞ node y table cost to x y z d(x, z) = min{d(x, y) + d(y, z), d(x, z) + d(z, z)} = min{2+1 , 7+0} = 3 x 0 2 3 y 2 0 1 z 7 1 0 x from x ∞ ∞ ∞ y 2 0 1 z ∞∞ ∞ node z table cost to x y z from d(x, y) = min{d(x, y) + d(y, y), d(x, z) + d(z, y)} = min{2+0 , 7+1} = 2 node x table cost to x y z x ∞∞ ∞ y ∞∞ ∞ z 71 0 10/2/2020 2 y 7 1 z Each node keeps track of the following info: 1. Its own distance vector: least-cost to each of other routers 2. Each of its neighbor’s distance vector received most recently If there is a change in distance vector, a node sends the update to all its neighbors time EEC-484/584: Computer Networks Wenbing Zhao
10/2/2020 from from from d(x, z) = min{d(x, y) + d(x, y) = min{d(x, y) + d(y, y), d(x, z) + d(z, y)} d(y, z), d(x, z) + d(z, z)} = min{2+0 , 7+1} = 2 = min{2+1 , 7+0} = 3 node x table cost to x y z x 0 2 7 x 0 2 3 y ∞∞ ∞ y 2 0 1 z 7 1 0 z ∞∞ ∞ z 3 1 0 node y table cost to x y z y x y z 2 1 x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z y 2 0 1 7 y 2 0 1 z ∞∞ ∞ z 7 1 0 z 3 1 0 node z table cost to x y z x 0 2 7 x 0 2 3 x ∞∞ ∞ y 2 0 1 y ∞∞ ∞ z 3 1 0 z 71 0 time EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing n n n Distance from A to B 12 ms, to C 25 ms, to D 40 ms, to G 18 ms Distance from J to A 8 ms, to I 10 ms, to H 12 ms, to K 6 ms Distance from J to A to G 8+18 = 26 ms to I to G 10+31 = 41 ms to H to G 12+6=18 ms to K to G 6+31=37 ms 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing n n n Good news travels fast Bad news travels slow Count to infinity problem: Takes too long to converge upon router failure × Routers’ knowledge about the cost to A 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Hierarchical Routing n Problem: Bigger network => bigger routing table q n Use hierarchical structure to solve the problem q q n As network size increases, more router memory used to store routing table, more time to process routing tables, more bandwidth to transmit states reports Regions: router knows details of how to route packets within its region, does not know internals of other regions Clusters of regions, zones of clusters, groups of zones Tradeoff: savings in memory space may result in longer path 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Hierarchical Routing Optimal number of levels for N routers is ln. N, with eln. N routing table entries per router 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Collection of Subnetworks The Internet is an interconnected collection of many networks, or Autonomous Systems (ASes) 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
The Network Layer in Internet Host, router network layer functions: Transport layer: TCP, UDP Network layer IP protocol • addressing conventions • datagram format • packet handling conventions Routing protocols • path selection • RIP, OSPF, BGP forwarding table ICMP protocol • error reporting • router “signaling” Link layer physical layer 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
IP Datagram Format IP protocol version number header length (bytes) “type” of data max number remaining hops (decremented at each router) upper layer protocol to deliver payload to How much overhead with TCP? • • • 20 bytes of TCP 20 bytes of IP = 40 bytes + app layer overhead 10/2/2020 32 bits Total length fragment 16 -bit identifier flgs offset time to protocol header live checksum type of ver IHL service total datagram length (bytes) for fragmentation/ reassembly 32 bit source IP address 32 bit destination IP address Options (if any) data (variable length, typically a TCP or UDP segment) EEC-484/584: Computer Networks E. g. timestamp, record route taken, specify list of routers to visit. Wenbing Zhao
The IPv 4 Header n n n Version – 4 IHL – length of header in 32 -bit words q Min 5, max 15 – i. e. , 60 bytes Type of service - to distinguish different classes of service q To accommodate differentiated services (which class this packet belongs to) Total length – header and data 65, 535 (216 -1) bytes Identification – allows destination to determine which datagram a fragment belongs to 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
The IPv 4 Header n Time to live – counter to limit packet lifetimes q q n n Max lifetime 255 sec Packet is destroyed when counter becomes 0 Protocol – which transport layer protocols being used Header checksum – verifies header 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
The IPv 4 Header n Options – security, error reporting, etc. q Some of the IP options 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
IP Fragmentation n Fragmentation Flags q q n DF – tells routers “Don’t Fragment” MF – More Fragments. All fragments except last have this set. Used as check against total length Fragment offset – where in datagram this fragment belongs q q q All fragments (payload in the IP packet) except last must be multiples of 8 bytes The number of 8 byte blocks is called Number of Fragment Blocks (NFB) The unit of the offset is NFB 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
IP Fragmentation & Reassembly n n Network links have MTU (max. transfer size) - largest possible link-level frame. q different link types, different MTUs Large IP datagram divided (“fragmented”) within net q one datagram becomes several datagrams q “reassembled” only at final destination q IP header bits used to identify, order related fragments 10/2/2020 fragmentation: in: one large datagram out: 3 smaller datagrams reassembly EEC-484/584: Computer Networks Wenbing Zhao
IP Fragmentation and Reassembly Example • 4000 byte datagram • MTU = 1500 bytes 1480 bytes in data field offset = 1480/8 length ID =4000 =x MF =0 offset =0 One large datagram becomes several smaller datagrams length ID =1500 =x MF =1 offset =0 length ID =1500 =x MF =1 offset =185 length ID =1040 =x MF =0 offset =370 Fragment should be as large as possible 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Distance Vector Routing: Exercise n Consider the subnet shown below. Distance vector routing is used, and the following vectors have just come in to router C: from B: (5, 0, 8, 12, 6, 2); from D: (16, 12, 6, 0, 9, 10); and from E: (7, 6, 3, 9, 0, 4). The measured delays to B, D, and E, are 6, 3, and 5, respectively. What is C's new routing table? Give both the outgoing line to use and the expected delay. 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
Exercise: IP Fragmentation n Suppose that host A is connected to a router R 1, R 1 is connected to another router, R 2, and R 2 is connected to host B. Suppose that a TCP message that contains 900 bytes of data and 20 bytes of TCP header is passed to the IP code at host A for delivery to B. Show the Total length, Identification, DF, MF, and Fragment offset fields of the IP header in each packet transmitted over the three links. Assume that link A-R 1 can support a maximum frame size of 1024 bytes including a 14 -byte frame header, link R 1 -R 2 can support a maximum frame size of 512 bytes, including an 8 -byte frame header, and link R 2 -B can support a maximum frame size of 512 bytes including a 12 -byte frame header. 10/2/2020 EEC-484/584: Computer Networks Wenbing Zhao
- Slides: 21