Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CSE401N: COMPUTER NetworkS LAN address & ARP Ethernet Basics.

Similar presentations


Presentation on theme: "1 CSE401N: COMPUTER NetworkS LAN address & ARP Ethernet Basics."— Presentation transcript:

1 1 CSE401N: COMPUTER NetworkS LAN address & ARP Ethernet Basics

2 2 LAN technologies Data link layer so far: m services, error detection/correction, multiple access Next: LAN technologies m addressing m Ethernet m hubs, bridges, switches m 802.11 m PPP m ATM

3 3 LAN Addresses and ARP 32-bit IP address: r network-layer address r used to get datagram to destination IP network (recall IP network definition) LAN (or MAC or physical or Ethernet) address: r used to get datagram from one interface to another physically-connected interface (same network) r 48 bit MAC address (for most LANs) burned in the adapter ROM

4 4 NIC or Network Adaptor

5 5 LAN Addresses and ARP Each adapter on LAN has unique LAN address

6 6 LAN Address (more) r MAC address allocation administered by IEEE r manufacturer buys portion of MAC address space (to assure uniqueness) r Analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address r MAC flat address => portability m can move LAN card from one LAN to another r IP hierarchical address NOT portable m depends on IP network to which node is attached

7 7 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.2 223.1.3.1 223.1.3.27 A B E Starting at A, given IP datagram addressed to E: r look up net. address of E, find C r link layer send datagram to C inside link-layer frame C’s MAC addr A’s MAC addr A’s IP addr E’s IP addr IP payload datagram frame frame source, dest address datagram source, dest address C

8 8 ARP: Address Resolution Protocol r Each IP node (Host, Router) on LAN has ARP table r ARP Table: IP/MAC address mappings for some LAN nodes m TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine MAC address of C knowing C’s IP address?

9 9 ARP protocol r A knows B's IP address, wants to learn physical address of B r A broadcasts ARP query pkt, containing B's IP address m all machines on LAN receive ARP query r B receives ARP packet, replies to A with its (B's) physical layer address r A caches (saves) IP-to-physical address pairs until information becomes old (times out) m soft state: information that times out (goes away) unless refreshed

10 10

11 11

12 12 Address Resolution Protocol (ARP) 1. With TCP/IP networking, a data packet must contain both a destination MAC address and a destination IP address. 2. Some devices will keep tables that contain MAC addresses and IP addresses of other devices that are connected to the same LAN. 3. These are called Address Resolution Protocol (ARP) tables. 4. ARP tables are stored in RAM memory, where the cached information is maintained automatically on each of the devices. 5. Each device on a network maintains its own ARP table. 6. When a network device wants to send data across the network, it uses information provided by the ARP table. 7. When a source determines the IP address for a destination, it then consults the ARP table in order to locate the MAC address for the destination. 8. If the source locates an entry in its table, destination IP address to destination MAC address, it will associate the IP address to the MAC address and then uses it to encapsulate the data. >arp -a

13 13 Address Resolution Protocol (ARP) 1.The computer that requires an IP and MAC address pair broadcasts an ARP request. 2.All the other devices on the local area network analyze this request, and if one of the local devices matches the IP address of the request, it sends back an ARP reply that contains its IP-MAC pair. 3.Another method to send data to the address of a device that is on another network segment is to set up a default gateway. 4.If the receiving host is not on the same segment, the source host sends the data using the actual IP address of the destination and the MAC address of the router.

14 14 ARP conversation HEY - Everyone please listen! Will 128.213.1.5 please send me his/her Ethernet address? not me Hi Green! I’m 128.213.1.5, and my Ethernet address is 87:A2:15:35:02:C3

15 15 RARP conversation HEY - Everyone please listen! My Ethernet address is 22:BC:66:17:01:75. Does anyone know my IP address ? not me Hi Green! Your IP address is 128.213.1.17.

16 16 Getting a datagram from source to dest. IP datagram: 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.2 223.1.3.1 223.1.3.27 A B E misc fields source IP addr dest IP addr data r datagram remains unchanged, as it travels source to destination r addr fields of interest here Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 routing table in A

17 17 Getting a datagram from source to dest. Starting at A, given IP datagram addressed to B: r look up net. address of B r find B is on same net. as A r link layer will send datagram directly to B inside link-layer frame m B and A are directly connected Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 misc fields 223.1.1.1223.1.1.3 data 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.2 223.1.3.1 223.1.3.27 A B E

18 18 Getting a datagram from source to dest. Dest. Net. next router Nhops 223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2 Starting at A, dest. E: r look up network address of E r E on different network m A, E not directly attached r routing table: next hop router to E is 223.1.1.4 r link layer sends datagram to router 223.1.1.4 inside link- layer frame r datagram arrives at 223.1.1.4 r continued….. misc fields 223.1.1.1223.1.2.3 data 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.2 223.1.3.1 223.1.3.27 A B E

19 19 Getting a datagram from source to dest. Arriving at 223.1.4, destined for 223.1.2.2 r look up network address of E r E on same network as router’s interface 223.1.2.9 m router, E directly attached r link layer sends datagram to 223.1.2.2 inside link-layer frame via interface 223.1.2.9 r datagram arrives at 223.1.2.2!!! (hooray!) misc fields 223.1.1.1223.1.2.3 data network router Nhops interface 223.1.1 - 1 223.1.1.4 223.1.2 - 1 223.1.2.9 223.1.3 - 1 223.1.3.27 Dest. next 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.2 223.1.3.1 223.1.3.27 A B E

20 20 Routing to another LAN walkthrough: routing from A to B via R r In routing table at source Host, find router 111.111.111.110 r In ARP table at source, find MAC address E6-E9- 00-17-BB-4B, etc A R B

21 21 r A creates IP packet with source A, destination B r A uses ARP to get R’s physical layer address for 111.111.111.110 r A creates Ethernet frame with R's physical address as dest, Ethernet frame contains A-to-B IP datagram r A’s data link layer sends Ethernet frame r R’s data link layer receives Ethernet frame r R removes IP datagram from Ethernet frame, sees its destined to B r R uses ARP to get B’s physical layer address r R creates frame containing A-to-B IP datagram sends to B A R B

22 22 Ethernet (IEEE 802.3) “dominant” LAN technology: r first widely deployed LAN technology r simpler, cheaper than token ring, FDDI, and ATM m Lesson learned: KISS (Keep It Simple, Stupid) r kept up with speed race: 10, 100, 1000 Mbps Metcalfe’s Ethernet sketch

23 23 Ethernet(2) r First widely used LAN Technology r Simpler than token ring, FDDI, or ATM r Comply with new Technology and Speed m Can run over coaxial cable,or twisted pair, or fiber optics or radio link m 10Mbps, 100Mbps, 1Gbps, 10Gbps. r Ethernet Hardware(Hub/Bridge/Switch) is widely available and cheap

24 24 Ethernet and the OSI Model

25 25 Ethernet and the OSI Model

26 26 Repeaters: Layer1 Device

27 27 Ethernet and the OSI Model

28 28 Naming(MAC Address)

29 29 802.3 Frame Structures

30 30 Ethernet Frame Structures

31 31 Ethernet Frame Structures

32 32 Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Preamble: r 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 r used to synchronize receiver, sender clock rates 8 66 2 46-1500 (including padding) 4

33 33 Ethernet Frame Structure(2) r Addresses: 6 bytes each m if adapter receives frame with matching destination address, or with broadcast address (e.g. ARP request), it passes data in frame to network layer m otherwise, adapter discards frame r Type (2 bytes): indicates the higher layer protocol, mostly IP but others may be supported (such as Novell IPX and AppleTalk) r Data (46-1500 bytes): MTU is 1500 bytes, MIN frame size = 46 + 18 = 64 bytes = 512 bits r CRC (4 bytes): checked at receiver, if error is detected, the frame is simply dropped

34 34 Unreliable, connectionless service r Connectionless: No handshaking between sending and receiving adapter. r Unreliable: receiving adapter doesn’t send ACKs or NAKs to sending adapter m stream of datagrams passed to network layer can have gaps m gaps will be filled if app is using TCP m otherwise, app will see the gaps

35 35 Ethernet: From Bit to Electrical Signal r Use Manchester encoding r One voltage change per bit m For a “1”, a voltage from 1 to 0 m For a “0”, a voltage from 0 to 1 r Example

36 36 MAC Rules & Collision Detection/Backoff

37 37 MAC Rules and Collision Detection/Backoff

38 38 Ethernet Timing r Slot time: m amount of time required to travel between the furthest points of the collision domain, collide with another transmission at the last possible instant, and then have the collision fragments return to the sending station and be detected.

39 39 Interframe Spacing and Backoff

40 40 The Basic MAC Mechanisms of Ethernet get a packet from upper layer; K := 0; n :=0; // K: random wait time; n: no. of collisions repeat: wait for K * 512 bit-time; while (network busy) wait; wait for 96 bit-time after detecting no signal; transmit and detect collision; if detect collision stop and transmit a 48-bit jam; n ++; m:= min(n, 10), where n is the number of collisions choose K randomly from {0, 1, 2, …, 2 m -1}. if n < 16 goto repeat else giveup CSMA/CD + Exponential backoff Question: Why exponential backoff?

41 41 Ethernet: uses CSMA/CD A: sense channel, if idle then { transmit and monitor the channel; If detect another transmission then { abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A } else {done with the frame; set collisions to zero} } else {wait until ongoing transmission is over and goto A}

42 42 Ethernet’s CSMA/CD (more) Jam Signal: make sure all other transmitters are aware of collision Bit time: 0.1 microsec for 10 Mbps Ethernet; for K=1023, wait time is about 50 msec Exponential Backoff: r Goal: adapt retransmission attempts to estimated current load m heavy load: random wait will be longer r first collision: choose K from {0,1}; delay is K x 512 bit transmission times r after second collision: choose K from {0,1,2,3}… r after ten or more collisions, choose K from {0,1,2,3,4,…,1023}

43 43 Why 64 bytes min frame length? r 10Base5 Ethernet: 10Mbps, max segment 500m, max 4 repeaters, max network diameter 2500m m Repeater: physical layer device that amplifies and retransmits bits it hears on one interface to its other interfaces, used to connect multiple segments r Round trip time (worst case collision detection time) about 50 microsec m All frames must take more than 50 microsec to send so that transmission is still taking place when the noise burst gets back to sender m With 10Mbps bandwidth, 1 bit time = 0.1 microsec  minimum frame size at least 500 bits, choose 512 bits to add some margin of safety r As network speed goes up, the minimum frame length must go up or the maximum cable length must come down m E.g. for a 2500m 1Gbps LAN, minimum frame size should be 6400 bytes

44 44 CSMA/CD efficiency r T prop = max prop. time between 2 nodes in LAN r t trans = time to transmit max-size frame r Efficiency goes to 1 as t prop goes to 0 r Efficiency goes to 1 as t trans goes to infinity r Much better than ALOHA, but still decentralized, simple, and cheap

45 45 Parameters for 10Mbps Ethernet


Download ppt "1 CSE401N: COMPUTER NetworkS LAN address & ARP Ethernet Basics."

Similar presentations


Ads by Google