Link Layer: CSM/CD, MC addresses, RP Smith College, CSC 249 March 29, 208 MC ddress q 32-bit IP address: network-layer address used to get datagram to destination IP subnet q MC (or LN, physical, thernet, hardware) address: function: get frame from one interface to another physically-connected interface (same network) 48 bit MC address (for most LNs) burned in NIC ROM Written out as xx-xx-xx-xx-xx-xx in hexadecimal, base 6, so each numeral represents 4 bits e.g., 45-3-CD-28-5F-40 2
MC ddresses in Hexadecimal q 00 000 00 0 0 00 in base 2 q 9 8 6 4 in decimal for each nibble q 9 8 6 in hexadecimal 3 MC. IP ddresses q MC address allocation administered by I q ach manufacturer buys a portion of MC address space (to assure uniqueness) q MC flat address portability can moe card from one LN to another no hierarchical structure to addresses q Note: IP addresses are NOT portable Hierarchical; and geographic significance Depends on IP subnet to which node is attached 4 2
MC addresses and RP each adapter on a LN has unique MC address -2F--76-09-D 7-65-F7-2-08-53 LN (wired or wireless) 58-23-D7-F-20-0 adapter 0C-C4--6F-3-98 Deliering a datagram: Single Subnet misc fields 223... 223...3 data Starting at, gien IP datagram addressed to : q Look up IP address of q Find is on same subnet as q Link layer will send datagram directly to inside link-layer frame and are directly connected q Remember definition of SUNT? routing table in Dest. Net. next router Nhops 223.. 223..2 223...4 2 223..3 223...4 2 223... 223...2 223..2. 223...4 223..2.9 223...3 223..3. 223..3.27 223..2.2 223..3.2 6 3
Deliering a datagram: Different Subnet misc fields 223... 223..2.2 data Starting at, dest. : q Look up network address of q on different subnet, not directly attached q Routing table: next hop router to is 223...4 q Link layer sends datagram to router 223...4 inside linklayer frame q Datagram arries at 223...4 q Process continues.. routing table in Dest. Net. next router Nhops 223.. 223..2 223...4 2 223..3 223...4 2 223... 223...2 223..2. 223...4 223..2.9 223...3 223..3. 223..3.27 223..2.2 223..3.2 7 RP: ddress Resolution Protocol Question: how to determine MC address of receier knowing receier s IP address? 237.96.7.23 7-65-F7-2-08-53 237.96.7.88 LN 237.96.7.78-2F--76-09-D 237.96.7.4 58-23-D7-F-20-0 0C-C4--6F-3-98 q ach node (Host, Router) on LN maintains an RP table q RP Table: IP/MC address mappings for some LN nodes < IP address; MC address; TTL> TTL ~ 20 minutes q Find more mappings ia RP query and response messages and by receiing frames 8 4
Slide xample: Creating an RP Table For the same LN segment: q wants to send datagram to, and s MC address not in s RP table. q broadcasts RP query packet, containing 's IP address Dest MC address = FF-FF-FF-FF-FF-FF ll machines on LN receie RP query RP Packets contain IP & MC address for source and destination caches (saes) IP-to-MC address pair in its RP table q receies RP packet, responds to with its ('s) MC address Why does only respond? frame sent directly to s MC address (not broadcast) q RP is plug-and-play : nodes create their RP tables without interention from net administrator 9 Question on Handout q Proide MC address and IP addresses for the interfaces at Host, both routers, and Host F. q Simplify the MC addresses by writing them as all the same number (or letter) for all 6 bytes. q For Subnet, use addresses of the form 92.68..xxx, q For Subnet 2, 92.68.2.xxx q For Subnet 3, 92.68.3.xxx. q (The large dots are switches.) to be discussed 0 5
Question on Handout C 92.68..00 00-00-00-00-00-00 92.68.2.00 44-44-44-44-44-44 92.68.3.00 77-77-77-77-77-77 LN Router LN Router 2 LN 92.68..002 22-22-22-22-22-22 92.68.2.002 33-33-33-33-33-33 92.68.2.003 55-55-55-55-55 92.68.3.002 88-88-88-88-88-88 92.68..003 ----- D 92.68.2.004 66-66-66-66-66 92.68.3.003 99-99-99-99-99-99 F Slide xample: Sending to another LN Send datagram from to ia R Ø assume knows s IP address R q Two RP tables in router R, one for each IP network (LN) 2 6
) creates IP datagram with source, destination 2) uses RP to get R s MC address for...0 3) creates link-layer frame with R's MC address as destintaion, frame contains -to- IP datagram 4) s adapter sends frame 5) R s adapter receies frame 74-29-9C-8-FF-55......2 CC-49-D-D0--7D 6-9-00-7--4-23-F9-CD-06-9...0 R 222.222.222.220 88-2-2F-54--0F 222.222.222.22 222.222.222.222 49-D-D2-C7-56-2 3 4) s adapter sends frame 5) R s adapter receies frame 6) R remoes IP datagram from thernet frame, sees it s destined to 7) R uses RP to get s MC address 8) R creates frame containing -to- IP datagram, and sends it to 74-29-9C-8-FF-55......2 CC-49-D-D0--7D 6-9-00-7--4-23-F9-CD-06-9...0 R 222.222.222.220 88-2-2F-54--0F 222.222.222.22 222.222.222.222 49-D-D2-C7-56-2 4 7
Problem 3 on Handout q Suppose Host sends a datagram to F. q Gie the source and destination MC addresses in the frame encapsulating the IP datagram as the frame is transmitted q from to the left router, q from the left router to the right router q from the right router to F. q lso gie the source and destination IP addresses of the IP datagram encapsulated within the frame at each of these points in time. 5 Problem 3 on Handout q Host sends a datagram to F. q Gie the source and destination MC addresses from to the left router: S MC ; D MC from the left router to the right router: S MC ; D MC from the right router to F: S MC ; D MC q lso gie the source and destination IP addresses of the IP datagram encapsulated within the frame at each of these points in time. LN Router LN 92.68..00 00-00-00-00-00-00 92.68..002 22-22-22-22-22-22 92.68..003 ----- 92.68.2.002 33-33-33-33-33-33 C D 92.68.2.00 44-44-44-44-44-44 92.68.2.003 55-55-55-55-55 92.68.2.004 66-66-66-66-66 92.68.3.00 77-77-77-77-77-77 Router 2 92.68.3.002 88-88-88-88-88-88 92.68.3.003 99-99-99-99-99-99 F LN 8
thernet Connections: Hubs q Hubs repeat receied bits on one interface to all other interfaces at the same rate no buffering (no store-and-forward) no CSM/CD at q physical layer deice examines no headers xtends max distance between nodes good Creates one large collision domain bad Cannot interconnect different physical media Comp Science ngineering Chemistry 8 Interconnecting with s 9 9
Interconnecting with switches 2 3 switch Selectiely forwards frames based on MC destination address Uses store-and-forward Uses CSM/CD Transparent to hosts, and so to IP Self-learning to build address table 20 Switch: traffic isolation q Switch installation breaks subnet into LN segments q Switch filters packets: same-ln-segment frames not usually forwarded onto other LN segments segments become separate collision domains switch collision domain collision domain collision domain 23 0
Switches: Self learning q switch has a switch table q n entry in a switch table contains: (MC ddress, Interface, Time Stamp) stale entries in table dropped (TTL can be 60 min) q Switch learns which hosts can be reached through which interfaces when frame receied, switch learns location of sender: incoming LN segment records sender/location pair in switch table 24 Switch table example Suppose C sends frame to switch 2 3 address G C interface 2 3 I C D F G H q Switch receies frame from from C Notes that and C are in same segment Switch does nothing 25
Switch example Suppose C sends frame to D switch 2 3 address G C interface 2 3 I C D F G H q Switch receies frame from from C Notes in switch table that C is on interface ecause D is not in table, switch forwards frame into interfaces 2 and 3 q Frame receied by D; (but nothing is added to the table) 26 Switch example Suppose D replies back with frame to C. switch 2 3 address I G C D interface 2 3 2 C D F G H q Switch receies frame from from D Notes in switch table that D is on interface 2 ecause C is in table, switch forwards frame only to interface q Frame receied by C 27 2
Problem 4 (on handout) q Replace the router between subnets and 2 with a switch S, and label the router between 2 and 3 as R l. q Consider sending an IP datagram from Host to Host F. Will Host ask router R l to help forward the datagram? Why? In the thernet frame containing the IP datagram, what are the source and destination IP and MC addresses? q Suppose would like to send an IP datagram to, and assume that 's RP cache does not contain 's MC address. Will perform an RP query to find 's MC address? Why? In the thernet frame (containing the IP datagram destined to ) that is deliered to router R, what are the source and destination IP and MC addresses? 29 Figure for Question q From Host to Host F. Will Host ask router R l to help? What are the source and destination IP and MC addresses? S R q Host to Host, and assume that s RP cache does not contain s MC address. Will perform an RP query? In the thernet frame (withthe IP datagram to ) that is deliered to router R, what are the source and destination IP and MC addresses? 3
Problem 4 (on handout) q Suppose Host would like to send an IP datagram to Host, and neither 's RP cache contains 's MC address nor does 's RP cache contain 's MC address. Further suppose that the switch S's forwarding table contains entries for Host and router R l only. Thus, will broadcast an RP request message. What actions will switch S perform once it receies the RP request message? Will router R also receie this RP request message? If so, will R forward the message to Subnet 3? Once Host receies this RP request message, it will send back to Host an RP response message. ut will it send an RP query message to ask for 's MC address? Why? What will switch S do once it receies an RP response message from Host? 3 Figure for Question q Host to Host. s RP cache does not contain s MC address. s RP cache does not contain s MC address. ssume switch S s forwarding table contains entries for Host and router R l only. Thus, will broadcast an RP request message. S Ø Ø What actions will switch S perform once it receies the RP request message? Will router R also receie this RP request message? Ø If so, will R forward the message to Subnet 3? R Ø Once Host receies this RP request message, it will send back to Host an RP response message. ut will it send an RP query message to ask for 's MC address? Why? Ø What will switch S do once it receies an RP response message from Host? 4
Switches s. Routers q both store-and-forward deices Routers are network layer deices Switches are link layer deices Hubs are physical layer repeaters q Routers maintain routing tables, implement routing algorithms q Switches maintain switch tables, implement filtering, learning algorithms Hub 33 Summary comparison qhub qswitch qrouter 34 5
Chapter 6: Summary q Data link layer serices: error detection and correction sharing a broadcast channel: multiple access link layer addressing Plug-and-play for RP and switch table learning q Link layer technologies thernet switched LNS (switches. s) 38 Midterm xam Scores 4 2 0 8 6 4 2 0 < 60 60 70 80 90 6