Chapter 1 Introduction A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:  If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!)  If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK/KWR All material copyright 1996-2007 J.F Kurose and K.W. Ross, All Rights Reserved

Introduction

Computer Networking: A Top Down Approach , 4th edition. Jim Kurose, Keith Ross Addison-Wesley, July 2007.

1-1

Circuit Switching: FDM and TDM Example:

FDM

4 users

frequency

time TDM

frequency

time Introduction

1-2

Packet Switching: Statistical Multiplexing 100 Mb/s Ethernet

A

B

C

statistical multiplexing 1.5 Mb/s

queue of packets waiting for output link D

E

Sequence of A & B packets does not have fixed pattern, bandwidth shared on demand  statistical multiplexing. TDM: each host gets same slot in revolving TDM frame. Introduction

1-3

Packet switching versus circuit switching Packet switching allows more users to use network! • 1 Mb/s link • each user: – 100 kb/s when “active” – active 10% of time N users

• circuit-switching:

1 Mbps link

– 10 users

• packet switching: – with 35 users, probability > 10 active at same time is less than .0004

Q: how did we get value 0.0004?

Introduction

1-4

Internet structure: network of networks • “Tier-2” ISPs: smaller (often regional) ISPs – Connect to one or more tier-1 ISPs, possibly other tier-2 ISPs

Tier-2 ISP pays tier-1 ISP for connectivity to rest of Internet  tier-2 ISP is customer of tier-1 provider

Tier-2 ISP

Tier-2 ISP

Tier 1 ISP

Tier 1 ISP

Tier 1 ISP Tier-2 ISP

Tier-2 ISPs also peer privately with each other.

Tier-2 ISP

Tier-2 ISP Introduction

1-5

Internet structure: network of networks • “Tier-3” ISPs and local ISPs – last hop (“access”) network (closest to end systems) local ISP Local and tier3 ISPs are customers of higher tier ISPs connecting them to rest of Internet

Tier 3 ISP

Tier-2 ISP

local ISP

local ISP

local ISP Tier-2 ISP

Tier 1 ISP

Tier 1 ISP

Tier-2 ISP local local ISP ISP

Tier 1 ISP Tier-2 ISP local ISP Introduction

Tier-2 ISP local ISP 1-6

Internet structure: network of networks • a packet passes through many networks! local ISP

Tier 3 ISP

Tier-2 ISP

local ISP

local ISP

local ISP Tier-2 ISP

Tier 1 ISP

Tier 1 ISP Tier-2 ISP local local ISP ISP

Tier 1 ISP Tier-2 ISP local ISP Introduction

Tier-2 ISP local ISP 1-7

Layering of airline functionality ticket (purchase)

ticket (complain)

ticket

baggage (check)

baggage (claim

baggage

gates (load)

gates (unload)

gate

runway (takeoff)

runway (land)

takeoff/landing

airplane routing

airplane routing

airplane routing departure airport

airplane routing

airplane routing

intermediate air-traffic control centers

arrival airport

Layers: each layer implements a service

– via its own internal-layer actions – relying on services provided by layer below Introduction

1-8

Why layering? Dealing with complex systems: • explicit structure allows identification, relationship of complex system’s pieces

– layered reference model for discussion • modularization eases maintenance, updating of system

– change of implementation of layer’s service transparent to rest of system – e.g., change in gate procedure doesn’t affect rest of system • layering considered harmful?

Introduction

1-9

ISO/OSI reference model • presentation: allow applications to interpret meaning of data, e.g., encryption, compression, machinespecific conventions • session: synchronization, checkpointing, recovery of data exchange • Internet stack “missing” these layers! – these services, if needed, must be implemented in application – needed?

Introduction

Application presentation Session Transport network Link physical

1-10

Internet protocol stack • application: supporting network applications – FTP, SMTP, HTTP

• transport: process-process data transfer – TCP, UDP

• network: routing of datagrams from source to destination – IP, routing protocols

• link: data transfer between neighboring network elements

application Transport

Network Link physical

– PPP, Ethernet

• physical: bits “on the wire” Introduction

1-11

source message segment

M

Ht

M

datagram Hn Ht

M

frame Hl Hn Ht

M

Encapsulation

application transport network link physical

link physical switch

destination M Ht

M

Hn Ht Hl Hn Ht

M M

application transport network link physical

Hn Ht Hl Hn Ht

M

M

network link physical

Hn Ht

M

router

Introduction

1-12

Creating a network app write programs that

application transport network data link physical

– run on (different) end systems – communicate over network – e.g., web server software communicates with browser software

No need to write software for network-core devices – Network-core devices do not run user applications – applications on end systems allows for rapid app development, propagation 2: Application Layer

application transport network data link physical

application transport network data link physical

13

Application architectures • Client-server • Peer-to-peer (P2P) • Hybrid of client-server and P2P

2: Application Layer

14

Client-server architecture server:

– always-on host – permanent IP address – server farms for scaling clients: client/server

– – – –

communicate with server may be intermittently connected may have dynamic IP addresses do not communicate directly with each other

2: Application Layer

15

Pure P2P architecture • no always-on server • arbitrary end systems directly communicate peer-peer • peers are intermittently connected and change IP addresses

Highly scalable but difficult to manage

2: Application Layer

16

Hybrid of client-server and P2P Skype

– voice-over-IP P2P application – centralized server: finding address of remote party: – client-client connection: direct (not through server)

Instant messaging

– chatting between two users is P2P – centralized service: client presence detection/location

• user registers its IP address with central server when it comes online • user contacts central server to find IP addresses of buddies 2: Application Layer

17

Processes communicating Process: program running within a host. • within same host, two processes communicate using inter-process communication (defined by OS). • processes in different hosts communicate by exchanging messages

Client process: process that initiates communication Server process: process that waits to be contacted

 Note: applications with P2P architectures have client processes & server processes

2: Application Layer

18

Sockets • process sends/receives messages to/from its socket • socket analogous to door – sending process shoves message out door – sending process relies on transport infrastructure on other side of door which brings message to socket at receiving process

host or server

host or server

process

controlled by app developer

process socket

socket TCP with buffers, variables

Internet

TCP with buffers, variables

controlled by OS

 API: (1) choice of transport protocol; (2) ability to fix a few parameters (lots more on this later) 2: Application Layer

19

Addressing processes • to receive messages, process must have identifier • host device has unique 32-bit IP address • Q: does IP address of host suffice for identifying the process?

2: Application Layer

20

Addressing processes • to receive messages, process must have identifier • host device has unique 32bit IP address • Q: does IP address of host on which process runs suffice for identifying the process? – A: No, many processes can be running on same host

• identifier includes both IP address and port numbers associated with process on host. • Example port numbers: – HTTP server: 80 – Mail server: 25

• to send HTTP message to gaia.cs.umass.edu web server:

2: Application Layer

– IP address: 128.119.245.12 – Port number: 80

21

Internet protocol stack application Transport Network Link physical

Introduction

1-22

Transport service requirements of common apps Data loss

Throughput

Time Sensitive

file transfer e-mail Web documents real-time audio/video

no loss no loss no loss loss-tolerant

no no no yes, 100’s msec

stored audio/video interactive games instant messaging

loss-tolerant loss-tolerant no loss

elastic elastic elastic audio: 5kbps-1Mbps video:10kbps-5Mbps same as above few kbps up elastic

Application

2: Application Layer

yes, few secs yes, 100’s msec yes and no

23

Internet apps: application, transport protocols Application e-mail remote terminal access Web file transfer streaming multimedia Internet telephony

Application layer protocol

Underlying transport protocol

SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] HTTP (eg Youtube), RTP [RFC 1889] SIP, RTP, proprietary (e.g., Skype)

TCP TCP TCP TCP TCP or UDP

2: Application Layer

typically UDP

24

Transport services and protocols • provide logical communication between app processes running on different hosts • transport protocols run in end systems – send side: breaks app messages into segments, passes to network layer – rcv side: reassembles segments into messages, passes to app layer • more than one transport protocol available to apps – Internet: TCP and UDP Transport Layer

application transport network data link physical

application transport network data link physical

3-25

Internet transport protocols services TCP service:

UDP service:

• connection-oriented: setup required between client and server processes • reliable transport between sending and receiving process • flow control: sender won’t overwhelm receiver • congestion control: throttle sender when network overloaded • does not provide: timing, minimum throughput guarantees, security

• unreliable data transfer between sending and receiving process • does not provide: connection setup, reliability, flow control, congestion control, timing, throughput guarantee, or security Q: why bother? Why is there a UDP?

2: Application Layer

26

Multiplexing/demultiplexing Multiplexing at send host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing)

Demultiplexing at rcv host:

delivering received segments to correct socket = socket application

= process P3

P1 P1 application

P2

P4

application

transport

transport

transport

network

network

network

link

link

physical

physical

host 1

link physical

host 2 Transport Layer

host 3 3-27

How demultiplexing works • host receives IP datagrams – each datagram has source IP address, destination IP address – each datagram carries 1 transport-layer segment – each segment has source, destination port number • host uses IP addresses & port numbers to direct segment to appropriate socket

32 bits source port #

dest port #

other header fields

application data (message)

TCP/UDP segment format Transport Layer

3-28

Connectionless demux (cont) DatagramSocket serverSocket = new DatagramSocket(6428); P2

SP: 6428 DP: 9157

client IP: A

P1 P1

P3

SP: 9157 DP: 6428

SP: 6428 DP: 5775

server IP: C

SP: 5775 DP: 6428

Client IP:B

SP provides “return address” Transport Layer

3-29

Connection-oriented demux • TCP socket identified by 4tuple: – – – –

• Server host may support many simultaneous TCP sockets:

source IP address source port number dest IP address dest port number

– each socket identified by its own 4-tuple

• recv host uses all four values to direct segment to appropriate socket

• Web servers have different sockets for each connecting client – non-persistent HTTP will have different socket for each request

Transport Layer

3-30

Connection-oriented demux (cont) P1

P4

P5

P2

P6

P1P3

SP: 5775 DP: 80 S-IP: B D-IP:C

client IP: A

SP: 9157 DP: 80 S-IP: A D-IP:C

server IP: C

Transport Layer

SP: 9157 DP: 80 S-IP: B D-IP:C

Client IP:B

3-31

Connection-oriented demux: Threaded Web Server

P1

P2

P4

P1P3

SP: 5775 DP: 80 S-IP: B D-IP:C

client IP: A

SP: 9157 DP: 80 S-IP: A D-IP:C

server IP: C

Transport Layer

SP: 9157 DP: 80 S-IP: B D-IP:C

Client IP:B

3-32

UDP: [RFC 768] • often used for streaming multimedia apps – loss tolerant – rate sensitive

• other UDP uses

32 bits Length, in bytes of UDP segment, including

– DNS – SNMP • reliable transfer over UDP: add reliability at application layer – application-specific error recovery!

source port # length

dest port # checksum

header

Application data (message)

UDP segment format Transport Layer

3-33

TCP: Overview • point-to-point:

RFCs: 793, 1122, 1323, 2018, 2581

• full duplex data:

– one sender, one receiver

– bi-directional data flow in same connection – MSS: maximum segment size

• reliable, in-order byte steam: – no “message boundaries”

• connection-oriented:

• pipelined:

– handshaking (exchange of control msgs) init’s sender, receiver state before data exchange

– TCP congestion and flow control set window size

• send & receive buffers

• flow controlled: socket door

application writes data

application reads data

TCP send buffer

TCP receive buffer

socket door

– sender will not overwhelm receiver

segment

Transport Layer

3-34

TCP segment structure 32 bits URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP)

source port #

dest port #

sequence number acknowledgement number head not len used

U A P R S F Receive window checksum Urg data pnter

Options (variable length)

counting by bytes of data (not segments!) # bytes rcvr willing to accept

application data (variable length)

Transport Layer

3-35

TCP seq. #’s and ACKs Seq. #’s: – byte stream “number” of first byte in segment’s data ACKs: – seq # of next byte expected from other side – cumulative ACK Q: how receiver handles outof-order segments – A: TCP spec doesn’t say, - up to implementor

Host A

Host B

User types ‘C’

host ACKs receipt of ‘C’, echoes back ‘C’

host ACKs receipt of echoed ‘C’ time simple telnet scenario Transport Layer

3-36

Internet protocol stack application Transport Network Link physical

Introduction

1-37

Two Key Network-Layer Functions • forwarding: move packets from router’s input to appropriate router output • routing: determine route taken by packets from source to dest.

analogy:  routing: process of

planning trip from source to dest  forwarding: process of

getting through single interchange

– routing algorithms Network Layer

4-38

Interplay between routing and forwarding routing algorithm

local forwarding table header value output link 0100 0101 0111 1001

3 2 2 1

value in arriving packet’s header 0111

1 3 2

Network Layer

4-39

The Internet Network layer 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

Network Layer

4-40

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

32 bits head. type of

length len service fragment 16-bit identifier flgs offset upper time to header layer live checksum

ver

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)

Network Layer

E.g. timestamp, record route taken, specify list of routers to visit.

4-41

IP Addressing: introduction • IP address: 32-bit identifier for host, router interface • interface: connection between host/router and physical link – router’s typically have multiple interfaces – host typically has one interface – IP addresses associated with each interface

223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3

223.1.2.9

223.1.3.27

223.1.2.2

223.1.3.2

223.1.3.1

223.1.1.1 = 11011111 00000001 00000001 00000001 223 Network Layer

1

1

1 4-42

Subnets • IP address:

223.1.1.1

– subnet part (high order bits) – host part (low order bits)

• What’s a subnet ? – device interfaces with same subnet part of IP address – can physically reach each other without intervening router

223.1.2.1

223.1.1.2 223.1.1.4 223.1.1.3

223.1.2.9

223.1.3.27

223.1.2.2

subnet 223.1.3.1

223.1.3.2

network consisting of 3 subnets

Network Layer

4-43

Subnets

223.1.1.0/24

223.1.2.0/24

Recipe • To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet. 223.1.3.0/24

Subnet mask: /24

Network Layer

4-44

IP addressing: CIDR CIDR: Classless InterDomain Routing – subnet portion of address of arbitrary length – address format: a.b.c.d/x, where x is # bits in subnet portion of address

host part

subnet part

11001000 00010111 00010000 00000000 200.23.16.0/23 Network Layer

4-45

IP addresses: how to get one? Q: How does network get subnet part of IP addr? A: gets allocated portion of its provider ISP’s address space ISP's block

11001000 00010111 00010000 00000000

200.23.16.0/20

Organization 0 Organization 1 Organization 2 ...

11001000 00010111 00010000 00000000 11001000 00010111 00010010 00000000 11001000 00010111 00010100 00000000 ….. ….

200.23.16.0/23 200.23.18.0/23 200.23.20.0/23 ….

Organization 7

11001000 00010111 00011110 00000000

200.23.30.0/23

Network Layer

4-46

IP addressing: the last word...

Q: How does an ISP get block of addresses? A: ICANN: Internet Corporation for Assigned Names and Numbers

– allocates addresses – manages DNS – assigns domain names, resolves disputes

Network Layer

4-47

NAT: Network Address Translation rest of Internet

local network (e.g., home network) 10.0.0/24 10.0.0.4

10.0.0.1

10.0.0.2

138.76.29.7 10.0.0.3

All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers

Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual)

Network Layer

4-48

NAT: Network Address Translation • Motivation: local network uses just one IP address as far as outside world is concerned:

– range of addresses not needed from ISP: just one IP address for all devices – can change addresses of devices in local network without notifying outside world – can change ISP without changing addresses of devices in local network – devices inside local net not explicitly addressable, visible by outside world (a security plus). Network Layer

4-49

NAT: Network Address Translation Implementation: NAT router must:

– outgoing datagrams: replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr.

– remember (in NAT translation table) every (source IP address, port #) to (NAT IP address, new port #) translation pair – incoming datagrams: replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table Network Layer

4-50

NAT: Network Address Translation NAT translation table WAN side addr LAN side addr

2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table

1: host 10.0.0.1 sends datagram to 128.119.40.186, 80

138.76.29.7, 5001 10.0.0.1, 3345 …… ……

S: 10.0.0.1, 3345 D: 128.119.40.186, 80

10.0.0.1

1 2

S: 138.76.29.7, 5001 D: 128.119.40.186, 80

138.76.29.7 S: 128.119.40.186, 80 D: 138.76.29.7, 5001

3: Reply arrives dest. address: 138.76.29.7, 5001

3

10.0.0.4 S: 128.119.40.186, 80 D: 10.0.0.1, 3345

10.0.0.2

4

10.0.0.3 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345 Network Layer

4-51

NAT: Network Address Translation

• 16-bit port-number field: – 60,000 simultaneous connections with a single LAN-side address!

• NAT is controversial: – routers should only process up to layer 3 – violates end-to-end argument • NAT possibility must be taken into account by app designers, eg, P2P applications

– address shortage should instead be solved by IPv6 Network Layer

4-52

NAT traversal problem • client wants to connect to server with address 10.0.0.1 – server address 10.0.0.1 local to LAN (client can’t use it as destination addr) – only one externally visible NATted address: 138.76.29.7

• solution 1: statically configure NAT to forward incoming connection requests at given port to server

Client

10.0.0.1

? 10.0.0.4

138.76.29.7

NAT router

– e.g., (123.76.29.7, port 2500) always forwarded to 10.0.0.1 port 25000

Network Layer

453

NAT traversal problem • solution 2: Universal Plug and Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATted host to:

learn public IP address (138.76.29.7) 138.76.29.7 add/remove port mappings (with lease times)

10.0.0.1

IGD 10.0.0.4

NAT router

i.e., automate static NAT port map configuration Network Layer

454

NAT traversal problem • solution 3: relaying (used in Skype)

– NATed client establishes connection to relay – External client connects to relay – relay bridges packets between to connections 2. connection to relay initiated by client Client

3. relaying established

1. connection to relay initiated by NATted host 138.76.29.7

10.0.0.1

NAT router

Network Layer

455

IPv6 • Initial motivation: 32-bit address space soon to be completely allocated. • Additional motivation: – header format helps speed processing/forwarding – header changes to facilitate QoS IPv6 datagram format: – fixed-length 40 byte header – no fragmentation allowed

Network Layer

4-56

IPv6 Header (Cont) Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper layer protocol for data

Network Layer

4-57

Other Changes from IPv4 • Checksum: removed entirely to reduce processing time at each hop • Options: allowed, but outside of header, indicated by “Next Header” field • ICMPv6: new version of ICMP – additional message types, e.g. “Packet Too Big” – multicast group management functions

Network Layer

4-58

Transition From IPv4 To IPv6 • Not all routers can be upgraded simultaneous – no “flag days” – How will the network operate with mixed IPv4 and IPv6 routers?

• Tunneling: IPv6 carried as payload in IPv4 datagram among IPv4 routers

Network Layer

4-59

Tunneling Logical view:

Physical view:

E

F

IPv6

IPv6

IPv6

A

B

E

F

IPv6

IPv6

IPv6

IPv6

A

B

IPv6

tunnel

IPv4

Network Layer

IPv4

4-60

Tunneling Logical view:

Physical view:

A

B

IPv6

IPv6

A

B

C

IPv6

IPv6

IPv4

Flow: X Src: A Dest: F

data

A-to-B: IPv6

E

F

IPv6

IPv6

D

E

F

IPv4

IPv6

IPv6

tunnel

Src:B Dest: E

Src:B Dest: E

Flow: X Src: A Dest: F

Flow: X Src: A Dest: F

data

data

B-to-C: IPv6 inside IPv4

Network Layer

B-to-C: IPv6 inside IPv4

Flow: X Src: A Dest: F

data

E-to-F: IPv6 4-61

Internet protocol stack application Transport Network Link physical

Introduction

1-62

Link Layer: Introduction Some terminology: • hosts and routers are nodes • communication channels that connect adjacent nodes along communication path are links – wired links – wireless links – LANs

• layer-2 packet is a frame, encapsulates datagram

data-link layer has responsibility of transferring datagram from one node to adjacent node over a link 5: DataLink Layer

5-63

Where is the link layer implemented? • in each and every host • link layer implemented in “adaptor” (aka network interface card NIC)

host schematic application transport network link

– Ethernet card, PCMCI card, 802.11 card – implements link, physical layer

cpu

memory

controller

• attaches into host’s system buses • combination of hardware, software, firmware 5: DataLink Layer

link physical

host bus (e.g., PCI)

physical transmission

network adapter card

5-64

MAC Addresses and ARP • 32-bit IP address: – network-layer address – used to get datagram to destination IP subnet

• MAC (or LAN or physical or Ethernet) address: – function: get frame from one interface to another physically-connected interface (same network) – 48 bit MAC address (for most LANs) • burned in NIC ROM, also sometimes software settable

5: DataLink Layer

5-65

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 – address depends on IP subnet to which node is attached

5: DataLink Layer

5-66

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

1A-2F-BB-76-09-AD

LAN (wired or wireless) 71-65-F7-2B-08-53

Broadcast address = FF-FF-FF-FF-FF-FF

= adapter 58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

5: DataLink Layer

5-67

ARP: Address Resolution Protocol • Each IP node (host, router) on LAN has ARP table • ARP table: IP/MAC address mappings for some LAN nodes

Question: how to determine MAC address of B knowing B’s IP address? 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.23

137.196.7.14

LAN 71-65-F7-2B-08-53

58-23-D7-FA-20-B0

< IP address; MAC address; TTL> –

TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)

0C-C4-11-6F-E3-98 137.196.7.88 5: DataLink Layer

5-68

ARP protocol: Same LAN (network) • A wants to send datagram to B, and B’s MAC address not in A’s ARP table. • A broadcasts ARP query packet, containing B's IP address – dest MAC address = FF-FFFF-FF-FF-FF – all machines on LAN receive ARP query • B receives ARP packet, replies to A with its (B's) MAC address

• A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) – soft state: information that times out (goes away) unless refreshed

• ARP is “plug-and-play”:

– frame sent to A’s MAC address (unicast)

5: DataLink Layer

– nodes create their ARP tables without intervention from net administrator

5-69

Addressing: routing to another LAN walkthrough: send datagram from A to B via R assume A knows B’s IP address 88-B2-2F-54-1A-0F

74-29-9C-E8-FF-55

A 111.111.111.111

E6-E9-00-17-BB-4B 1A-23-F9-CD-06-9B

222.222.222.220 111.111.111.110 111.111.111.112

R

222.222.222.221

222.222.222.222

B 49-BD-D2-C7-56-2A

CC-49-DE-D0-AB-7D

• two ARP tables in router R, one for each IP network (LAN)

5: DataLink Layer

5-70

• A creates IP 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 contains A-to-B IP datagram This is a really important • A’s NIC sends frame example – make sure you understand! • R’s NIC receives frame • R removes IP datagram from Ethernet frame, sees its destined to B • R uses ARP to get B’s MAC address • R creates frame containing A-to-B IP datagram sends to B 88-B2-2F-54-1A-0F

74-29-9C-E8-FF-55

A E6-E9-00-17-BB-4B 111.111.111.111

222.222.222.220 111.111.111.110 111.111.111.112

222.222.222.221

1A-23-F9-CD-06-9B

R

222.222.222.222

B 49-BD-D2-C7-56-2A

CC-49-DE-D0-AB-7D

5: DataLink Layer

5-71

Ethernet Frame Structure (more) • Addresses: 6 bytes – if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to network layer protocol – otherwise, adapter discards frame

• Type: indicates higher layer protocol (mostly IP but others possible, e.g., Novell IPX, AppleTalk) • CRC: checked at receiver, if error is detected, frame is dropped

5: DataLink Layer

5-72

Switches vs. Routers • both store-and-forward devices – routers: network layer devices (examine network layer headers) – switches are link layer devices

• routers maintain routing tables, implement routing algorithms • switches maintain switch tables, implement filtering, learning algorithms

5: DataLink Layer

5-73