MAC Addresses and ARP ❒ 32-bit IP address: ❍ network-layer address Mac Addressing, Ethernet, and ❍ used to get datagram to destination IP subnet ❒ MAC (or LAN or physical or Ethernet) Interconnections 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 5: DataLink Layer 5-1 5: DataLink Layer 5-2 LAN Addresses and ARP LAN Address (more) Each adapter on LAN has unique LAN address ❒ MAC address allocation administered by IEEE ❒ manufacturer buys portion of MAC address space 1A-2F-BB-76-09-AD Broadcast address = (to assure uniqueness) FF-FF-FF-FF-FF-FF ❒ Analogy: (a) MAC address: like Social Security Number LAN = adapter (wired or (b) IP address: like postal address wireless) 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 ❒ MAC flat address ➜ portability ❍ can move LAN card from one LAN to another ❒ IP hierarchical address NOT portable 0C-C4-11-6F-E3-98 ❍ depends on IP subnet to which node is attached 5: DataLink Layer 5-3 5: DataLink Layer 5-4 ARP protocol: Same LAN (network) ARP: Address Resolution Protocol A wants to send datagram to ❒ ❒ Each IP node (Host, Question: how to determine B, and B’s MAC address not in A caches (saves) IP-to-MAC ❒ A’s ARP table. MAC address of B Router) on LAN has address pair in its ARP table A broadcasts ARP query until information becomes old ❒ ARP table knowing B’s IP address? packet, containing B's IP (times out) address ❒ ARP Table: IP/MAC ❍ soft state: information 237.196.7.78 ❍ Dest MAC address = FF- address mappings for that times out (goes 1A-2F-BB-76-09-AD FF-FF-FF-FF-FF away) unless refreshed some LAN nodes ❍ all machines on LAN 237.196.7.23 237.196.7.14 ❒ ARP is “plug-and-play”: receive ARP query < IP address; MAC address; TTL> B receives ARP packet, ❍ nodes create their ARP LAN ❒ ❍ TTL (Time To Live): replies to A with its (B's) tables without 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 time after which MAC address intervention from net address mapping will be ❍ frame sent to A’s MAC administrator address (unicast) 0C-C4-11-6F-E3-98 forgotten (typically 20 237.196.7.88 min) 5: DataLink Layer 5-5 5: DataLink Layer 5-6 1
Routing to another LAN A creates datagram with source A, destination B ❒ A uses ARP to get R’s MAC address for 111.111.111.110 ❒ A creates link-layer frame with R's MAC address as dest, frame ❒ walkthrough: send datagram from A to B via R contains A-to-B IP datagram assume A know’s B IP address A’s adapter sends frame ❒ R’s adapter receives frame ❒ R removes IP datagram from Ethernet frame, sees its destined to ❒ B R uses ARP to get B’s MAC address ❒ A R creates frame containing A-to-B IP datagram sends to B ❒ A R B Two ARP tables in router R, one for each IP network (LAN) R ❒ B In routing table at source Host, find router 111.111.111.110 ❒ In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc ❒ 5: DataLink Layer 5-7 5: DataLink Layer 5-8 Star topology Ethernet “dominant” wired LAN technology: ❒ Bus topology popular through mid 90s ❒ cheap $20 for 100Mbs! ❒ Now star topology prevails ❒ first widely used LAN technology ❒ Connection choices: hub or switch (more later) ❒ Simpler, cheaper than token LANs and ATM ❒ Kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ethernet sketch hub or switch 5: DataLink Layer 5-9 5: DataLink Layer 5-10 Ethernet Frame Structure Ethernet Frame Structure (more) Sending adapter encapsulates IP datagram (or other ❒ Addresses: 6 bytes network layer protocol packet) in Ethernet frame ❍ if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to net-layer protocol ❍ otherwise, adapter discards frame ❒ Type: indicates the higher layer protocol (mostly Preamble: IP but others may be supported such as Novell ❒ 7 bytes with pattern 10101010 followed by one IPX and AppleTalk) byte with pattern 10101011 ❒ CRC: checked at receiver, if error is detected, ❒ used to synchronize receiver, sender clock rates the frame is simply dropped 5: DataLink Layer 5-11 5: DataLink Layer 5-12 2
Manchester encoding Unreliable, connectionless service ❒ Connectionless: No handshaking between sending and receiving adapter. ❒ Unreliable: receiving adapter doesn’t send acks or nacks to sending adapter ❍ stream of datagrams passed to network layer can have gaps ❒ Used in 10BaseT ❍ gaps will be filled if app is using TCP ❒ Each bit has a transition ❍ otherwise, app will see the gaps ❒ Allows clocks in sending and receiving nodes to synchronize to each other ❍ no need for a centralized, global clock among nodes! ❒ Hey, this is physical-layer stuff! 5: DataLink Layer 5-13 5: DataLink Layer 5-14 Ethernet CSMA/CD algorithm Ethernet uses CSMA/CD 1. Adaptor receives datagram 4. If adapter detects another ❒ No slots ❒ Before attempting a from net layer & creates frame transmission while retransmission, transmitting, aborts and sends 2. If adapter senses channel idle, ❒ adapter doesn’t transmit jam signal it starts to transmit frame. If adapter waits a if it senses that some it senses channel busy, waits 5. After aborting, adapter enters random time, that is, other adapter is until channel idle and then exponential backoff : after the random access transmitting, that is, transmits mth collision, adapter chooses carrier sense a K at random from 3. If adapter transmits entire {0,1,2,…,2 m -1}. Adapter waits frame without detecting ❒ transmitting adapter K · 512 bit times and returns to another transmission, the aborts when it senses Step 2 adapter is done with frame ! that another adapter is transmitting, that is, collision detection 5: DataLink Layer 5-15 5: DataLink Layer 5-16 10BaseT and 100BaseT Ethernet’s CSMA/CD (more) ❒ 10/100 Mbps rate; latter called “fast ethernet” Jam Signal: make sure all Exponential Backoff: ❒ T stands for Twisted Pair other transmitters are ❒ Goal : adapt retransmission ❒ Nodes connect to a hub: “star topology”; 100 m aware of collision; 48 bits attempts to estimated max distance between nodes and hub Bit time: .1 microsec for 10 current load Mbps Ethernet ; ❍ heavy load: random wait for K=1023, wait time is will be longer about 50 msec ❒ first collision: choose K twisted pair from {0,1}; delay is K · 512 bit transmission times See/interact with Java ❒ after second collision: applet on AWL Web site: hub choose K from {0,1,2,3}… highly recommended ! ❒ after ten collisions, choose K from {0,1,2,3,4,…,1023} 5: DataLink Layer 5-17 5: DataLink Layer 5-18 3
Hubs Gbit Ethernet Hubs are essentially physical-layer repeaters: ❍ bits coming from one link go out all other links ❒ uses standard Ethernet frame format ❍ at the same rate ❒ allows for point-to-point links and shared ❍ no frame buffering broadcast channels ❍ no CSMA/CD at hub: adapters detect collisions ❒ in shared mode, CSMA/CD is used; short distances between nodes required for efficiency ❍ provides net management functionality ❒ uses hubs, called here “Buffered Distributors” twisted pair ❒ Full-Duplex at 1 Gbps for point-to-point links ❒ 10 Gbps now ! hub 5: DataLink Layer 5-19 5: DataLink Layer 5-20 Interconnecting with hubs Switch ❒ Backbone hub interconnects LAN segments ❒ Link layer device ❒ Extends max distance between nodes ❍ stores and forwards Ethernet frames ❒ But individual segment collision domains become one ❍ examines frame header and selectively large collision domain forwards frame based on MAC dest address ❒ Can’t interconnect 10BaseT & 100BaseT ❍ when frame is to be forwarded on segment, uses CSMA/CD to access segment hub ❒ transparent ❍ hosts are unaware of presence of switches hub hub hub ❒ plug-and-play, self-learning ❍ switches do not need to be configured 5: DataLink Layer 5-21 5: DataLink Layer 5-22 Forwarding Self learning switch 1 ❒ A switch has a switch table 3 2 ❒ entry in switch table: ❍ (MAC Address, Interface, Time Stamp) hub hu hub ❍ stale entries in table dropped (TTL can be 60 min) b ❒ switch learns which hosts can be reached through which interfaces ❍ when frame received, switch “learns” location of sender: incoming LAN segment • How do determine onto which LAN segment to ❍ records sender/location pair in switch table forward frame? • Looks like a routing problem... 5: DataLink Layer 5-23 5: DataLink Layer 5-24 4
Recommend
More recommend