introduction computer networking: a top down approach 6 th edition jim kurose, keith ross...
TRANSCRIPT
Introduction
Computer Networking A Top Down Approach 6th edition Jim Kurose Keith RossAddison-WesleyMarch 2012
Basic Networking Concepts
Davide Pesaventodavidepesaventolip6fr
Transport Layer
Internet transport-layer protocols reliable in-order
delivery (TCP) congestion
control flow control connection setup
unreliable unordered delivery UDP no-frills
extension of ldquobest-effortrdquo IP
services not available delay
guarantees bandwidth
guarantees
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
logical end-end transport
3-3
UDP User Datagram Protocol [RFC 768] ldquono frillsrdquo ldquobare
bonesrdquo Internet transport protocol
ldquobest effortrdquo service UDP segments may be lost delivered out-
of-order to app connectionless
no handshaking between UDP sender receiver
each UDP segment handled independently of others
UDP use streaming
multimedia apps (loss tolerant rate sensitive)
DNS SNMP
reliable transfer over UDP add reliability at
application layer application-specific
error recovery
3-4
3-5
UDP segment header
source port dest port
32 bits
applicationdata
(payload)
UDP segment format
length checksum
length in bytes of UDP segment
including header
no connection establishment (which can add delay)
simple no connection state at sender receiver
small header size no congestion
control UDP can blast away as fast as desired
why is there a UDP
3-6
TCP Overview RFCs 79311221323 2018 2581
full duplex data bi-directional
data flow in same connection
MSS maximum segment size
connection-oriented handshaking
(exchange of control msgs) inits sender receiver state before data exchange
flow controlled sender will not
overwhelm receiver
point-to-point one sender one
receiver reliable in-order
byte steam no ldquomessage
boundariesrdquo pipelined
TCP congestion and flow control set window size
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
Transport Layer
Internet transport-layer protocols reliable in-order
delivery (TCP) congestion
control flow control connection setup
unreliable unordered delivery UDP no-frills
extension of ldquobest-effortrdquo IP
services not available delay
guarantees bandwidth
guarantees
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
logical end-end transport
3-3
UDP User Datagram Protocol [RFC 768] ldquono frillsrdquo ldquobare
bonesrdquo Internet transport protocol
ldquobest effortrdquo service UDP segments may be lost delivered out-
of-order to app connectionless
no handshaking between UDP sender receiver
each UDP segment handled independently of others
UDP use streaming
multimedia apps (loss tolerant rate sensitive)
DNS SNMP
reliable transfer over UDP add reliability at
application layer application-specific
error recovery
3-4
3-5
UDP segment header
source port dest port
32 bits
applicationdata
(payload)
UDP segment format
length checksum
length in bytes of UDP segment
including header
no connection establishment (which can add delay)
simple no connection state at sender receiver
small header size no congestion
control UDP can blast away as fast as desired
why is there a UDP
3-6
TCP Overview RFCs 79311221323 2018 2581
full duplex data bi-directional
data flow in same connection
MSS maximum segment size
connection-oriented handshaking
(exchange of control msgs) inits sender receiver state before data exchange
flow controlled sender will not
overwhelm receiver
point-to-point one sender one
receiver reliable in-order
byte steam no ldquomessage
boundariesrdquo pipelined
TCP congestion and flow control set window size
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
Internet transport-layer protocols reliable in-order
delivery (TCP) congestion
control flow control connection setup
unreliable unordered delivery UDP no-frills
extension of ldquobest-effortrdquo IP
services not available delay
guarantees bandwidth
guarantees
application
transportnetworkdata linkphysical
application
transportnetworkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
logical end-end transport
3-3
UDP User Datagram Protocol [RFC 768] ldquono frillsrdquo ldquobare
bonesrdquo Internet transport protocol
ldquobest effortrdquo service UDP segments may be lost delivered out-
of-order to app connectionless
no handshaking between UDP sender receiver
each UDP segment handled independently of others
UDP use streaming
multimedia apps (loss tolerant rate sensitive)
DNS SNMP
reliable transfer over UDP add reliability at
application layer application-specific
error recovery
3-4
3-5
UDP segment header
source port dest port
32 bits
applicationdata
(payload)
UDP segment format
length checksum
length in bytes of UDP segment
including header
no connection establishment (which can add delay)
simple no connection state at sender receiver
small header size no congestion
control UDP can blast away as fast as desired
why is there a UDP
3-6
TCP Overview RFCs 79311221323 2018 2581
full duplex data bi-directional
data flow in same connection
MSS maximum segment size
connection-oriented handshaking
(exchange of control msgs) inits sender receiver state before data exchange
flow controlled sender will not
overwhelm receiver
point-to-point one sender one
receiver reliable in-order
byte steam no ldquomessage
boundariesrdquo pipelined
TCP congestion and flow control set window size
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
UDP User Datagram Protocol [RFC 768] ldquono frillsrdquo ldquobare
bonesrdquo Internet transport protocol
ldquobest effortrdquo service UDP segments may be lost delivered out-
of-order to app connectionless
no handshaking between UDP sender receiver
each UDP segment handled independently of others
UDP use streaming
multimedia apps (loss tolerant rate sensitive)
DNS SNMP
reliable transfer over UDP add reliability at
application layer application-specific
error recovery
3-4
3-5
UDP segment header
source port dest port
32 bits
applicationdata
(payload)
UDP segment format
length checksum
length in bytes of UDP segment
including header
no connection establishment (which can add delay)
simple no connection state at sender receiver
small header size no congestion
control UDP can blast away as fast as desired
why is there a UDP
3-6
TCP Overview RFCs 79311221323 2018 2581
full duplex data bi-directional
data flow in same connection
MSS maximum segment size
connection-oriented handshaking
(exchange of control msgs) inits sender receiver state before data exchange
flow controlled sender will not
overwhelm receiver
point-to-point one sender one
receiver reliable in-order
byte steam no ldquomessage
boundariesrdquo pipelined
TCP congestion and flow control set window size
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-5
UDP segment header
source port dest port
32 bits
applicationdata
(payload)
UDP segment format
length checksum
length in bytes of UDP segment
including header
no connection establishment (which can add delay)
simple no connection state at sender receiver
small header size no congestion
control UDP can blast away as fast as desired
why is there a UDP
3-6
TCP Overview RFCs 79311221323 2018 2581
full duplex data bi-directional
data flow in same connection
MSS maximum segment size
connection-oriented handshaking
(exchange of control msgs) inits sender receiver state before data exchange
flow controlled sender will not
overwhelm receiver
point-to-point one sender one
receiver reliable in-order
byte steam no ldquomessage
boundariesrdquo pipelined
TCP congestion and flow control set window size
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-6
TCP Overview RFCs 79311221323 2018 2581
full duplex data bi-directional
data flow in same connection
MSS maximum segment size
connection-oriented handshaking
(exchange of control msgs) inits sender receiver state before data exchange
flow controlled sender will not
overwhelm receiver
point-to-point one sender one
receiver reliable in-order
byte steam no ldquomessage
boundariesrdquo pipelined
TCP congestion and flow control set window size
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-7
TCP segment structure
source port dest port
32 bits
applicationdata
(variable length)
sequence number
acknowledgement number
receive window
Urg data pointerchecksum
FSRPAUheadlen
notused
options (variable length)
URG urgent data (generally not used)
ACK ACK valid
PSH push data now(generally not used)
RST SYN FINconnection estab(setup teardown
commands)
bytes rcvr willingto accept
countingby bytes of data(not segments)
Internetchecksum
(as in UDP)
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-8
TCP seq numbers ACKs
sequence numbersbyte stream ldquonumberrdquo of first byte in segmentrsquos data
acknowledgementsseq of next byte expected from other side
cumulative ACKQ how receiver handles out-of-order segmentsA TCP spec doesnrsquot say - up to implementor
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
incoming segment to sender
A
sent ACKed
sent not-yet ACKed(ldquoin-flightrdquo)
usablebut not yet sent
not usable
window size N
sender sequence number space
source port dest port
sequence number
acknowledgement number
checksum
rwnd
urg pointer
outgoing segment from sender
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-9
TCP seq numbers ACKs
Usertypes
lsquoCrsquo
host ACKsreceipt
of echoedlsquoCrsquo
host ACKsreceipt oflsquoCrsquo echoesback lsquoCrsquo
simple telnet scenario
Host BHost A
Seq=42 ACK=79 data = lsquoCrsquo
Seq=79 ACK=43 data = lsquoCrsquo
Seq=43 ACK=80
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-10
TCP reliable data transfer TCP creates rdt
service on top of IPrsquos unreliable service pipelined
segments cumulative acks single
retransmission timer
retransmissions triggered by timeout events duplicate acks
letrsquos initially consider simplified TCP sender ignore duplicate
acks ignore flow
control congestion control
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-11
TCP sender eventsdata rcvd from
app create segment
with seq seq is byte-
stream number of first data byte in segment
start timer if not already running think of timer as
for oldest unacked segment
expiration interval TimeOutInterval
timeout retransmit
segment that caused timeout
restart timer ack rcvd if ack
acknowledges previously unacked segments update what is
known to be ACKed
start timer if there are still unacked segments
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-12
TCP retransmission scenarios
lost ACK scenario
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8 bytes of data
Xtim
eout
ACK=100
premature timeout
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=92 8bytes of data
tim
eout
ACK=120
Seq=100 20 bytes of data
ACK=120
SendBase=100
SendBase=120
SendBase=120
SendBase=92
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-13
TCP retransmission scenarios
X
cumulative ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
Seq=120 15 bytes of data
tim
eout
Seq=100 20 bytes of data
ACK=120
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-14
TCP ACK generation [RFC 1122 RFC
2581]
event at receiver
arrival of in-order segment withexpected seq All data up toexpected seq already ACKed
arrival of in-order segment withexpected seq One other segment has ACK pending
arrival of out-of-order segmenthigher-than-expect seq Gap detected
arrival of segment that partially or completely fills gap
TCP receiver action
delayed ACK Wait up to 500msfor next segment If no next segmentsend ACK
immediately send single cumulative ACK ACKing both in-order segments
immediately send duplicate ACK indicating seq of next expected byte
immediate send ACK provided thatsegment starts at lower end of gap
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-15
TCP fast retransmit time-out period
often relatively long long delay
before resending lost packet
detect lost segments via duplicate ACKs sender often
sends many segments back-to-back
if segment is lost there will likely be many duplicate ACKs
if sender receives 3 ACKs for same data(ldquotriple duplicate ACKsrdquo) resend unacked segment with smallest seq
likely that unacked segment lost so donrsquot wait for timeout
TCP fast retransmit
(ldquotriple duplicate ACKsrdquo)
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-16
X
fast retransmit after sender receipt of triple duplicate ACK
Host BHost A
Seq=92 8 bytes of data
ACK=100
tim
eout
ACK=100
ACK=100
ACK=100
TCP fast retransmit
Seq=100 20 bytes of data
Seq=100 20 bytes of data
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-17
TCP 3-way handshake
SYNbit=1 Seq=x
choose init seq num xsend TCP SYN msg
ESTAB
SYNbit=1 Seq=yACKbit=1 ACKnum=x+1
choose init seq num ysend TCP SYNACKmsg acking SYN
ACKbit=1 ACKnum=y+1
received SYNACK(x) indicates server is livesend ACK for SYNACK
this segment may contain client-to-server data
received ACK(y) indicates client is live
SYNSENT
ESTAB
SYN RCVD
client state
LISTEN
server state
LISTEN
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-18
TCP 3-way handshake FSM
closed
L
listen
SYNrcvd
SYNsent
ESTAB
Socket clientSocket = newSocket(hostnameport
number)
SYN(seq=x)
Socket connectionSocket = welcomeSocketaccept()
SYN(x)
SYNACK(seq=yACKnum=x+1)create new socket for communication back to client
SYNACK(seq=yACKnum=x+1)
ACK(ACKnum=y+1)ACK(ACKnum=y+1)
L
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-19
TCP closing a connection client server each close their side
of connection send TCP segment with FIN bit = 1
respond to received FIN with ACK on receiving FIN ACK can be
combined with own FIN simultaneous FIN exchanges can
be handled
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
3-20
FIN_WAIT_2
CLOSE_WAIT
FINbit=1 seq=y
ACKbit=1 ACKnum=y+1
ACKbit=1 ACKnum=x+1 wait for server
close
can stillsend data
can no longersend data
LAST_ACK
CLOSED
TIMED_WAIT
timed wait for 2max
segment lifetime
CLOSED
TCP closing a connection
FIN_WAIT_1 FINbit=1 seq=xcan no longersend but can receive data
clientSocketclose()
client state server state
ESTABESTAB
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
Network Layer
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-22
Network layer transport segment
from sending to receiving host
on sending side encapsulates segments into datagrams
on receiving side delivers segments to transport layer
network layer protocols in every host router
router examines header fields in all IP datagrams passing through it
applicationtransportnetworkdata linkphysical
applicationtransportnetworkdata linkphysical
networkdata linkphysical network
data linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysical
networkdata linkphysicalnetwork
data linkphysical
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-23
Two key network-layer functions
forwarding move packets from routerrsquos input to appropriate router output
routing determine route taken by packets from source to dest routing algorithms
analogy routing process of
planning trip from source to dest
forwarding process of getting through single interchange
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-24
1
23
0111
value in arrivingpacketrsquos header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Interplay between routing and forwarding
routing algorithm determinesend-end-path through network
forwarding table determineslocal forwarding at this router
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-25
The Internet network layer
forwardingtable
host router network layer functions
routing protocolsbull path selectionbull RIP OSPF BGP
IP protocolbull addressing conventionsbull datagram formatbull packet handling conventions
ICMP protocolbull error reportingbull router ldquosignalingrdquo
transport layer TCP UDP
link layer
physical layer
networklayer
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-26
ver length
32 bits
data (variable lengthtypically a TCP
or UDP segment)
16-bit identifier
header checksum
time tolive
32 bit source IP address
headlen
type ofservice
flgsfragment
offsetupper layer
32 bit destination IP address
options (if any)
IP datagram formatIP protocol version
numberheader length
(bytes)
upper layer protocolto deliver payload to
total datagramlength (bytes)
ldquotyperdquo of data forfragmentationreassemblymax number
remaining hops(decremented at
each router)
eg timestamprecord routetaken specifylist of routers to visit
how much overhead 20 bytes of TCP 20 bytes of IP = 40 bytes + app
layer overhead
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-27
IP fragmentation reassembly
network links have MTU (maxtransfer size) - largest possible link-level frame different link
types different MTUs
large IP datagram divided (ldquofragmentedrdquo) within net one datagram
becomes several datagrams
ldquoreassembledrdquo only at final destination
IP header bits used to identify order related fragments
fragmentation in one large datagramout 3 smaller datagrams
reassembly
hellip
hellip
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-28
ID=x
offset=0
fragflag=0
length=4000
ID=x
offset=0
fragflag=1
length=1500
ID=x
offset=185
fragflag=1
length=1500
ID=x
offset=370
fragflag=0
length=1040
one large datagram becomesseveral smaller datagrams
example 4000 byte
datagram MTU = 1500
bytes1480 bytes in data field
offset =14808
IP fragmentation reassembly
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-29
ICMP internet control message protocol used by hosts amp
routers to communicate network-level information error reporting
unreachable host network port protocol
echo requestreply (used by ping)
network-layer ldquoaboverdquo IP ICMP msgs carried in
IP datagrams ICMP message type
code plus first 8 bytes of IP datagram causing error
Type Code description0 0 echo reply (ping)3 0 dest network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable3 6 dest network unknown3 7 dest host unknown4 0 source quench (congestion control - not used)8 0 echo request (ping)9 0 route advertisement10 0 router discovery11 0 TTL expired12 0 bad IP header
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-30
Traceroute and ICMP source sends series
of UDP segments to dest first set has TTL =1 second set has TTL=2
etc unlikely port number
when nth set of datagrams arrives to nth router router discards
datagrams and sends source ICMP
messages (type 11 code 0)
ICMP messages includes name of router amp IP address
when ICMP messages arrives source records RTTs
stopping criteria UDP segment
eventually arrives at destination host
destination returns ICMP ldquoport unreachablerdquo message (type 3 code 3)
source stops3 probes
3 probes
3 probes
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-31
IPv6 motivation initial motivation 32-bit address space
soon to be completely allocated additional motivation
header format helps speed processingforwarding
header changes to facilitate QoS
IPv6 datagram format fixed-length 40 byte header no fragmentation allowed
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-32
IPv6 datagram format
priority identify priority among datagrams in flowflow Label identify datagrams in same ldquoflowrdquo (concept ofldquoflowrdquo not well defined)next header identify upper layer protocol for data
data
destination address(128 bits)
source address(128 bits)
payload len next hdr hop limitflow labelpriver
32 bits
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-33
Other changes from IPv4
checksum removed entirely to reduce processing time at each hop
options allowed but outside of header indicated by ldquoNext Headerrdquo field
ICMPv6 new version of ICMP additional message types eg ldquoPacket Too
Bigrdquo multicast group management functions
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-34
Transition from IPv4 to IPv6 not all routers can be upgraded
simultaneously no ldquoflag daysrdquo how will network operate with mixed
IPv4 and IPv6 routers tunneling IPv6 datagram carried as
payload in IPv4 datagram among IPv4 routers
IPv4 source dest addr IPv4 header fields
IPv4 datagram
IPv6 datagram
IPv4 payload
UDPTCP payload
IPv6 source dest addrIPv6 header fields
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-35
Tunneling
physical view
IPv4 IPv4
A B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-36
flow Xsrc Adest F
data
A-to-BIPv6
Flow XSrc ADest F
data
srcBdest E
B-to-CIPv6 inside
IPv4
E-to-FIPv6
flow Xsrc Adest F
data
B-to-CIPv6 inside
IPv4
Flow XSrc ADest F
data
srcBdest E
physical viewA B
IPv6 IPv6
E
IPv6 IPv6
FC D
logical view
IPv4 tunnel connecting IPv6 routers
E
IPv6 IPv6
FA B
IPv6 IPv6
Tunneling
IPv4 IPv4
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-37
R1
R2
R3 R4
sourceduplication
R1
R2
R3 R4
in-networkduplication
duplicatecreationtransmissionduplicate
duplicate
Broadcast routing deliver packets from source to all other
nodes source duplication is inefficient
source duplication how does source determine recipient addresses
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-38
In-network duplication
flooding when node receives broadcast packet sends copy to all neighbors problems cycles amp broadcast storm
controlled flooding node only broadcasts pkt if it hasnrsquot broadcast same packet before node keeps track of packet ids already
broadacsted or reverse path forwarding (RPF) only
forward packet if it arrived on shortest path between node and source
spanning tree no redundant packets received by any node
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
4-39
A
B
G
DE
c
F
A
B
G
DE
c
F
(a) broadcast initiated at A (b) broadcast initiated at D
Spanning tree
first construct a spanning tree nodes then forwardmake copies only
along spanning tree
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
Link Layer
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-41
Link layer introductionterminology hosts and routers
nodes communication
channels that connect adjacent nodes along communication path links wired links wireless links LANs
layer-2 packet frame encapsulates datagramdata-link layer has responsibility of
transferring datagram from one node to physically adjacent node over a link
global ISP
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-42
Link layer context
datagram transferred by different link protocols over different links eg Ethernet on
first link frame relay on intermediate links 80211 on last link
each link protocol provides different services eg may or may not
provide rdt over link
transportation analogy
trip from Princeton to Lausanne limo Princeton to JFK plane JFK to Geneva train Geneva to
Lausanne tourist = datagram transport segment =
communication link transportation mode =
link layer protocol travel agent = routing
algorithm
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-43
Multiple access links protocolstwo types of ldquolinksrdquo point-to-point
PPP for dial-up access point-to-point link between Ethernet switch host
broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC 80211 wireless LAN
shared wire (eg cabled Ethernet)
shared RF (eg 80211 WiFi)
shared RF(satellite)
humans at acocktail party
(shared air acoustical)
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-44
Multiple access protocols single shared broadcast channel two or more simultaneous transmissions by nodes
interference collision if node receives two or more signals at
the same time
multiple access protocol distributed algorithm that determines how nodes
share channel ie determine when node can transmit
communication about channel sharing must use channel itself no out-of-band channel for coordination
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-45
MAC protocols taxonomy
three broad classes channel partitioning
divide channel into smaller ldquopiecesrdquo (time slots frequency code)
allocate piece to node for exclusive use random access
channel not divided allow collisions ldquorecoverrdquo from collisions
ldquotaking turnsrdquo nodes take turns but nodes with more to send can
take longer turns
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-46
Channel partitioning MAC protocols TDMA
TDMA time division multiple access access to channel in rounds each station gets fixed length slot
(length = pkt trans time) in each round unused slots go idle example 6-station LAN 134 have pkt
slots 256 idle
1 3 4 1 3 4
6-slotframe
6-slotframe
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-47
FDMA frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go
idle example 6-station LAN 134 have pkt
frequency bands 256 idle
freq
uenc
y ba
nds
time
FDM cable
Channel partitioning MAC protocols FDMA
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-48
Random access protocols when node has packet to send
transmit at full channel data rate R no a priori coordination among nodes
two or more transmitting nodes ldquocollisionrdquo
random access MAC protocol specifies how to detect collisions how to recover from collisions (eg via
delayed retransmissions) examples of random access MAC
protocols slotted ALOHA ALOHA CSMA CSMACD CSMACA
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-49
CSMA (carrier sense multiple access)
CSMA listen before transmitif channel sensed idle transmit entire
frame if channel sensed busy defer
transmission
human analogy donrsquot interrupt others
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-50
CSMA collisions collisions can still
occur propagation delay means two nodes may not hear each otherrsquos transmission
collision entire packet transmission time wasted distance amp
propagation delay play role in in determining collision probability
spatial layout of nodes
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-51
CSMACD (collision detection)CSMACD carrier sensing deferral as in
CSMA collisions detected within short time colliding transmissions aborted reducing
channel wastage collision detection
easy in wired LANs measure signal strengths compare transmitted received signals
difficult in wireless LANs received signal strength overwhelmed by local transmission strength
human analogy the polite conversationalist
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-52
CSMACD (collision detection)
spatial layout of nodes
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-53
Ethernet CSMACD algorithm1 NIC receives
datagram from network layer creates frame
2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits
3 If NIC transmits entire frame without detecting another transmission NIC is done with frame
4 If NIC detects another transmission while transmitting aborts and sends jam signal
5 After aborting NIC enters binary (exponential) backoff after mth collision
NIC chooses K at random from 012 hellip 2m-1 NIC waits K512 bit times returns to Step 2
longer backoff interval with more collisions
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-54
MAC addresses and ARP
32-bit IP address network-layer address for interface used for layer 3 (network layer) forwarding
MAC (or LAN or physical or Ethernet) address function used lsquolocallyrdquo to get frame from one
interface to another physically-connected interface (same network in IP-addressing sense)
48 bit MAC address (for most LANs) burned in NIC ROM also sometimes software settable
eg 1A-2F-BB-76-09-ADhexadecimal (base 16) notation(each ldquonumberrdquo represents 4 bits)
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-55
LAN addresses and ARPeach adapter on LAN has unique LAN address
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN(wired orwireless)
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-56
ARP address resolution protocol
ARP table each IP node (host router) on LAN has table
IPMAC address mappings for some LAN nodes
lt IP address MAC address TTLgt TTL (Time To Live)
time after which address mapping will be forgotten (typically 20 min)
Question how to determineinterfacersquos MAC address knowing its IP address
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
71-65-F7-2B-08-53
LAN
137196723
137196778
137196714
137196788
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-57
ARP protocol same LAN A wants to send
datagram to B Brsquos MAC address not
in Arsquos ARP table A broadcasts ARP
query packet containing Bs IP address dest MAC address =
FF-FF-FF-FF-FF-FF all nodes on LAN
receive ARP query B receives ARP
packet replies to A with its (Bs) MAC address frame sent to Arsquos MAC
address (unicast)
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 ldquoplug-and-playrdquo nodes create their
ARP tables without intervention from net administrator
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-58
Ethernet frame structure
sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame
preamble 7 bytes with pattern 10101010 followed
by one byte with pattern 10101011 used to synchronize receiver sender
clock rates
destaddress
sourceaddress
data (payload) CRCpreamble
type
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-59
Ethernet frame structure (more) addresses 6 byte source destination MAC
addresses 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 eg Novell IPX AppleTalk)
CRC cyclic redundancy check at receiver error detected frame is droppeddest
addresssource
addressdata
(payload) CRCpreamble
type
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-60
Ethernet unreliable connectionless connectionless no handshaking between
sending and receiving NICs unreliable receiving NIC doesnt send acks
or nacks to sending NIC data in dropped frames recovered only if
initial sender uses higher layer rdt (eg TCP) otherwise dropped data lost
Ethernetrsquos MAC protocol unslotted CSMACD wth binary backoff
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-61
Synthesis a day in the life of a web request journey down protocol stack complete
application transport network link putting-it-all-together synthesis
goal identify review understand protocols (at all layers) involved in seemingly simple scenario requesting www page
scenario student attaches laptop to campus network requestsreceives wwwgooglecom
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
5-62
A day in the life scenario
Comcast network 68800013
Googlersquos network 64233160019 64233169105
web server
DNS server
school network 68802024
web page
browser
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
router(runs DHCP)
5-63
A day in the lifehellip connecting to the Internet
connecting laptop needs to get its own IP address addr of first-hop router addr of DNS server use DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCPDHCP
DHCP request encapsulated in UDP encapsulated in IP encapsulated in 8023 Ethernet
Ethernet frame broadcast (dest FFFFFFFFFFFF) on LAN received at router running DHCP server Ethernet demuxed to IP demuxed UDP demuxed to DHCP
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
router(runs DHCP)
5-64
DHCP server formulates DHCP ACK containing clientrsquos IP address IP address of first-hop router for client name amp IP address of DNS server
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCPUDP
IPEthPhy
DHCP
DHCP
DHCP
DHCP
DHCP
encapsulation at DHCP server frame forwarded (switch learning) through LAN demultiplexing at client
Client now has IP address knows name amp addr of DNS server IP address of its first-hop router
DHCP client receives DHCP ACK reply
A day in the lifehellip connecting to the Internet
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
router(runs DHCP)
5-65
A day in the lifehellip ARP (before DNS before HTTP)
before sending HTTP request need IP address of wwwgooglecom DNS
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS query created encapsulated in UDP encapsulated in IP encapsulated in Eth To send frame to router need MAC address of router interface ARP
ARP query broadcast received by router which replies with ARP reply giving MAC address of router interface client now knows MAC address of first hop router so can now send frame containing DNS query
ARP query
EthPhy
ARP
ARP
ARP reply
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
router(runs DHCP)
5-66
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
DNS
IP datagram containing DNS query forwarded via LAN switch from client to 1st hop router
IP datagram forwarded from campus network into comcast network routed (tables created by RIP OSPF IS-IS andor BGP routing protocols) to DNS server
demuxrsquoed to DNS server
DNS server replies to client with IP address of wwwgooglecom
Comcast network 68800013
DNS server
DNSUDP
IPEthPhy
DNS
DNS
DNS
DNS
A day in the lifehellip using DNS
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
router(runs DHCP)
5-67
A day in the lifehellipTCP connection carrying HTTP
HTTPTCPIP
EthPhy
HTTP
to send HTTP request client first opens TCP socket to web server
TCP SYN segment (step 1 in 3-way handshake) inter-domain routed to web server
TCP connection established
64233169105
web server
SYN
SYN
SYN
SYN
TCPIP
EthPhy
SYN
SYN
SYN
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
SYNACK
web server responds with TCP SYNACK (step 2 in 3-way handshake)
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-
router(runs DHCP)
5-68
A day in the lifehellip HTTP requestreply
HTTPTCPIP
EthPhy
HTTP
HTTP request sent into TCP socket
IP datagram containing HTTP request routed to wwwgooglecom
IP datagram containing HTTP reply routed back to client
64233169105
web server
HTTPTCPIP
EthPhy
web server responds with HTTP reply (containing web page)
HTTP
HTTP
HTTPHTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
HTTP
web page finally () displayed
- Slide 1
- Slide 2
- Internet transport-layer protocols
- UDP User Datagram Protocol [RFC 768]
- UDP segment header
- TCP Overview RFCs 79311221323 2018 2581
- TCP segment structure
- TCP seq numbers ACKs
- TCP seq numbers ACKs (2)
- TCP reliable data transfer
- TCP sender events
- TCP retransmission scenarios
- TCP retransmission scenarios (2)
- TCP ACK generation [RFC 1122 RFC 2581]
- TCP fast retransmit
- TCP fast retransmit (2)
- TCP 3-way handshake
- TCP 3-way handshake FSM
- TCP closing a connection
- TCP closing a connection (2)
- Slide 21
- Network layer
- Two key network-layer functions
- Slide 24
- The Internet network layer
- IP datagram format
- IP fragmentation reassembly
- IP fragmentation reassembly (2)
- ICMP internet control message protocol
- Traceroute and ICMP
- IPv6 motivation
- IPv6 datagram format
- Other changes from IPv4
- Transition from IPv4 to IPv6
- Tunneling
- Tunneling (2)
- Broadcast routing
- In-network duplication
- Spanning tree
- Slide 40
- Link layer introduction
- Link layer context
- Multiple access links protocols
- Multiple access protocols
- MAC protocols taxonomy
- Channel partitioning MAC protocols TDMA
- Channel partitioning MAC protocols FDMA
- Random access protocols
- CSMA (carrier sense multiple access)
- CSMA collisions
- CSMACD (collision detection)
- CSMACD (collision detection) (2)
- Ethernet CSMACD algorithm
- MAC addresses and ARP
- LAN addresses and ARP
- ARP address resolution protocol
- ARP protocol same LAN
- Ethernet frame structure
- Ethernet frame structure (more)
- Ethernet unreliable connectionless
- Synthesis a day in the life of a web request
- A day in the life scenario
- A day in the lifehellip connecting to the Internet
- A day in the lifehellip connecting to the Internet (2)
- A day in the lifehellip ARP (before DNS before HTTP)
- A day in the lifehellip using DNS
- A day in the lifehellipTCP connection carrying HTTP
- A day in the lifehellip HTTP requestreply
-