Summary of mac protocols o What do you do with a shared media? o Channel Partitioning by time, frequency or code Time Division, Code Division, Frequency Division o Random partitioning dynamic) ALOHA, S-ALOHA, CSMA, CSMA/CD carrier sensing: easy in some technoligies(wire), hard in others(wireless) CSMA/CD used in Ethernet o Taking Turns polling from a central cite, token passing 5: DataLink Layer 5a-1
5: DataLink Layer 5a-1 Summary of MAC protocols What do you do with a shared media? Channel Partitioning, by time, frequency or code • Time Division,Code Division, Frequency Division Random partitioning (dynamic), • ALOHA, S-ALOHA, CSMA, CSMA/CD • carrier sensing: easy in some technoligies (wire), hard in others (wireless) • CSMA/CD used in Ethernet Taking Turns • polling from a central cite, token passing
LAN technologies Data link layer so far: o services, error detection/correction, multiple access Next: LAN technologies o addressing o Ethernet o hubs, bridges, switches 802.11 user hosts O PPP Server O ATM Interne user hosts 5: DataLink Layer 5a-2
5: DataLink Layer 5a-2 LAN technologies Data link layer so far: services, error detection/correction, multiple access Next: LAN technologies addressing Ethernet hubs, bridges, switches 802.11 PPP ATM
LAN Addresses and aRp 32-bit IP address: 口 network- ayer address O used to get datagram to destination network (recall IP network definition) LAN (or MAC or physical)address O used to get datagram from one interface to another physically-connected interface(same network) 0 48 bit MaC address for most LaNs) burned in the adapter rom 5: DataLink Layer 5a-3
5: DataLink Layer 5a-3 LAN Addresses and ARP 32-bit IP address: network-layer address used to get datagram to destination network (recall IP network definition) LAN (or MAC or physical) address: used to get datagram from one interface to another physically-connected interface (same network) 48 bit MAC address (for most LANs) burned in the adapter ROM
LAN Addresses and ARP Each adapter on Lan has unique LAN address 1A-23F9-CD-06-9日 dapter node LAN 5C-66AB90-75-B1 88-日22F-54-1A0F 49-BD-D2C7-56-2A node 5: DataLink Lo 5a-4
5: DataLink Layer 5a-4 LAN Addresses and ARP Each adapter on LAN has unique LAN address
LAN Address(more) O MAC address allocation administered by ieee o manufacturer buys portion of mac address space (to assure uniqueness) 口 analogy: (a)MAC address: like Social Security Number (b)IP address: like postal address o MaC flat address = portability o can move lan card from one lan to another o IP hierarchical address not portable o depends on network to which one attaches 5: DataLink Layer 5a-5
5: DataLink Layer 5a-5 LAN Address (more) MAC address allocation administered by IEEE manufacturer buys portion of MAC address space (to assure uniqueness) Analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address MAC flat address => portability can move LAN card from one LAN to another IP hierarchical address NOT portable depends on network to which one attaches
Recall earlier routing discussion Starting at A, given IP 恩 223.1.1.1 datagram addressed to b: 22312.1 o look up net address of b find B 2 23.1.1.2 on same net, as a 223.1.2.9 g link layer send datagram to B 223.1 inside link-layer frame 223.1.13223.1.327 2 ED 223.1.3 223.1.3.2 frame source datagram source, dest address dest address Bs MAC A's MAC As IP addr Bs IP IP po payload adar addr adar datagram frame 5: DataLink Layer 5a-6
5: DataLink Layer 5a-6 Recall earlier routing discussion 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.1 223.1.3.2 223.1.3.27 A B E Starting at A, given IP datagram addressed to B: look up net. address of B, find B on same net. as A link layer send datagram to B inside link-layer frame B’s MAC addr A’s MAC addr A’s IP addr B’s IP addr IP payload datagram frame frame source, dest address datagram source, dest address
ARP: Address resolution protocol Question: how to determine D Each IP node(host, MAC address of B Router on lan has given B's IP address? ARP module table 口 arP Table:IP/MAC 2222222220 address mappings for 1A-23-F9cD06-9日 some LAN nodes adapter IP address, MAC address, TTL> 222222.222223 nod nodel-222.222.222.221 LAN o TTL (Time To Live): time after which address 5C-66-AB-90-75日 88-日22F54-1A0F mapping will be forgotten (typically 20 min) 49-RD-D2-C7-56-2A nde-222222 5: DataLink Layer 5a-7
5: DataLink Layer 5a-7 ARP: Address Resolution Protocol Each IP node (Host, Router) on LAN has ARP module, table ARP Table: IP/MAC address mappings for some LAN nodes TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine MAC address of B given B’s IP address?
ARP protoco O A knows bs IP address, wants to learn physical address of b O A broadcasts arP query pkt, containing B's IP address o all machines on LAN receive ARP query o B receives ARP packet, replies to A with its(Bs) physical layer address O A caches(saves)IP-to-physical address pairs until information becomes old (times out) o soft state: information that times out (goes away) unless refreshed 5: DataLink Layer 5a-8
5: DataLink Layer 5a-8 ARP protocol A knows B's IP address, wants to learn physical address of B A broadcasts ARP query pkt, containing B's IP address all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) physical layer address A caches (saves) IP-to-physical address pairs until information becomes old (times out) soft state: information that times out (goes away) unless refreshed
Routing to another LAN walkthrough: routing from a to B via R 88-日2-2F-54-1A0F 74-29-9c-E8-FF-55 E6-E9-00-17BB-4日 hos A hoe 111.111.111.1 1A-23-F9-CD-06-9g 222.222.222.221 LAN 1 ROUTER AN 2 R 222.222.222.222 111.111.111.1 22222222220 111.111.111.110 Hoed hoe 49-日D-D2-C7-56-2A C-49-DE-DO-A8-7D 5: DataLink Layer 5a-9
5: DataLink Layer 5a-9 Routing to another LAN walkthrough: routing from A to B via R A R B
D A creates IP packet with source A, destination B o A uses aRP to get R's physical layer address for 111.111.111.110 o A creates Ethernet frame with Rs physical address as dest Ethernet frame contains A-to-b IP datagram D As data link layer sends Ethernet frame o R's data link layer receives ethernet frame o R removes ip datagram from ethernet frame sees its destined to b o R uses ARP to get B's physical layer address o R creates frame containing a-to-b iP datagram sends to B 88-日2-2F-54-1A-0F 74-29-9c-E8-FF-55 alhe E6-E9-00-17-BB-4日 11111111 1A-23-F9cD-06-9g 222.222.222.221 LAN 1 ROUTER LAN 2 R 222.222,222.222 222222222.230 111.111.111 host 111.111.111.110 B 49-BD-D2-C7-56-2A CC-49-DE-D0-AB-7D yer 5a-10
5: DataLink Layer 5a-10 A creates IP packet with source A, destination B A uses ARP to get R’s physical layer address for 111.111.111.110 A creates Ethernet frame with R's physical address as dest, Ethernet frame contains A-to-B IP datagram A’s data link layer sends Ethernet frame R’s data link layer receives Ethernet frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get B’s physical layer address R creates frame containing A-to-B IP datagram sends to B A R B