lec20 protocols and standards
lec20 protocols and standards
Tapan Parikh
Spring 2013
Network Cryptography …
Network Standards
& Protocols
process p process q
send m receive
Communication channel
Outgoing message buffer Incoming message buffer
Network
client server
Network: Routers & Links
A
1
B
Hosts
2
3
Links
4
or local
C
networks
5
D
6
E
Routers
Client
Wireless ISP
7Corporate
LAN
Mobile Client
Network Types circa 2000
Range
Bandwidth (Mbps)
Latency (ms)
LAN
1-2 kms
10-1000
1-10
WAN
worldwide
0.010-600
100-500
MAN
2-50 kms
1-150
10
Wireless LAN
0.15-1.5 km
2-11
5-20
Wireless WAN
worldwide
0.010-2
100-500
Internet
worldwide
0.010-2
100-500
Source: Coulouris, Dollimore and Kindberg
Layer 7
Application • Application (layer 7): specific to
layer application need
Layer 6
Presentation • Presentation (layer 6): conversion
layer of data representation
Layer 5
Session • Session (layer 5): access mgt,
layer synchronization
Layer 4
Transport • Transport (layer 4): end-to-end
layer delivery, congestion and flow
Network control
Layer 3
layer • Network (layer 3): addressing,
Data link routing
Layer 2
layer • Data Link (layer 2): framing, error
Physical detection
Layer 1
layer • Physical (layer 1): bits (0/1),
voltages, frequencies, wires, pins, …
ISO/OSI Reference Model
Layered Protocol Architecture
Application
Layer 7 Layer 7
layer Application Software
layer
Presentation
Layer 6
layer Socket API
Session
Layer 5 Transport
layer Layer 4
layer
Transport
Layer 4 Operating
layer
System
Network Network
Layer 3 Layer 3
layer layer
Data link
Layer 2 Layer 2
layer Link layer
Hardware
Physical
Layer 1 Physical layer Layer 1
layer
point-to-point
Link Link Link Link
end-to-end
Appl Appl
point-to-point
Link Link Link Link
Appl Appl
Trans Trans
port port
Data
Trans Trans
port port
Data
Link Link Link Link
HTTP message
TCP header
port
HTTP message
IP header
TCP
TCP segment
Ethernet header
IP
IP datagram/packet
Ethernet frame
Adapted from Coulouris, Dollimore and Kindberg
Ensuring Reliability
• Layering:
– Hourglass: many different applications and
underlying network technologies, but
Internet Protocol establishes universal
addressing scheme
– Envelope/Encapsulation: layer-specific
functionalities; isolation between layers
• Reliable communication over unreliable
network
– IP provides “best-effort” packet delivery
service
– TCP supports retransmission of lost packets
Internetworking Standards
point-to-point
Link Link Link Link
Bit 0 Bit 31
Version Hdr Len
(4) (4)
TOS (8) Total Length in bytes (16)
128 32 226 87
0 8 16 24 31
10000000 00100000 11100010 01010111
Packet Switching (Routing)
Host A Host B
12.2.14.60 128.32.226.87
Two Basic Functions in Packet
Switching
• Routing
– Learn the best route to (or best next-hop for)
any given destination
• Routers exchange local link status or destination
reachability information
• Compute best path to destinations
– Algorithms for computing shortest paths (e.g., Dijkstra’s)
– Policies that reflect business agreements (use BGP)
– Update the routing table
• Packet forwarding
– For each packet received on an incoming link,
forward it to an outgoing link according to the
routing table
Network Utilities
• Run from Terminal in unix/mac
– Ping: round trip time on an IP network from the
originating host to the destination computer
– Traceroute: displaying the route (path) and
measuring transit delays of packets across an IP
network
$ ping www.ischool.berkeley.edu!
PING www.ischool.berkeley.edu (128.32.78.21): 56 data bytes
!
64 bytes from 128.32.78.21: icmp_seq=0 ttl=61 time=0.846 ms
!
64 bytes from 128.32.78.21: icmp_seq=1 ttl=61 time=0.915 ms
!
!
!
TraceRoute
!
$ traceroute www.ischool.berkeley.edu!
traceroute to www.ischool.berkeley.edu (128.32.78.21), 64 hops max, 52 byte packets!
1 g2-11.inr-270-doecev.berkeley.edu (128.32.226.1) 0.681 ms 0.362 ms 0.495 ms!
2 g3-3.inr-202-reccev.berkeley.edu (128.32.255.34) 0.437 ms 0.540 ms 0.476 ms!
3 t5-5.inr-211-srb.berkeley.edu (128.32.255.127) 0.626 ms 0.648 ms 1.163 ms!
4 www (128.32.78.21) 0.930 ms 1.220 ms 1.085 ms!
!
$ traceroute www.google.com!
traceroute: Warning: www.google.com has multiple addresses; using 74.125.224.83!
traceroute to www.l.google.com (74.125.224.83), 64 hops max, 52 byte packets!
1 g2-11.inr-270-doecev.berkeley.edu (128.32.226.1) 0.673 ms 0.431 ms 0.427 ms!
2 g3-3.inr-201-sut.berkeley.edu (128.32.255.32) 0.482 ms 0.505 ms 0.510 ms!
3 xe-0-1-0.inr-001-sut.berkeley.edu (128.32.0.64) 0.597 ms 0.450 ms 0.355 ms!
4 dc-svl-agg1--ucb-10ge.cenic.net (137.164.50.18) 10.662 ms 7.790 ms 6.443 ms!
5 dc-svl-core1--svl-agg1-10ge.cenic.net (137.164.47.121) 3.623 ms 3.477 ms
3.133 ms!
6 dc-svl-px1--svl-core1-10ge-2.cenic.net (137.164.46.13) 4.791 ms 3.045 ms
2.955 ms!
7 137.164.131.61 (137.164.131.61) 3.582 ms 3.415 ms 3.637 ms!
8 137.164.130.94 (137.164.130.94) 8.095 ms 58.649 ms 7.700 ms!
9 216.239.49.250 (216.239.49.250) 4.307 ms 4.829 ms 4.534 ms!
10 64.233.174.19 (64.233.174.19) 4.943 ms 4.812 ms 5.091 ms!
11 nuq04s07-in-f19.1e100.net (74.125.224.83) 4.528 ms 4.510 ms 4.802 ms!
Packet Switch in Action
Data Plane
Destination Outgoing
Address Link
w.x.y.z C
point-to-point
Link Link Link Link
Hdr Len
(4)
Reserved (6) Flags (6) Window Size (16)
message
client
server
other ports
Internet address = 138.37.94.248
Internet address = 138.37.88.249
Process A Process B
Data
Data
Data Packet Loss
time
Reliable Delivery
• Positive acknowledgment with
retransmission
• Sequence and acknowledgement
numbers
0 16 31
Data
Reliable Delivery
• Each packet has a sequence number (SEQ)
– SEQ represents byte offset with respect to initial SEQ
– Duplicate packets can be detected and discarded
– Out of order packets can be re-ordered
Data (Seq=x+1)
Data (Ack=x+2)
Data (Seq=x+2) IP loses packet
Timeout
Data (Ack=x+3)
time
ACK and Packet Retransmission
Process A Process B
Data (Seq=x+1)
Data (Ack=x+2)
Data (Seq=x+2)
Timeout
time
User Datagram Protocol
• Port numbers for addressing
• No mechanism for reliable data transfer
• Light-weight:
– low overhead; no connection setup
– used for real-time applications (don’t need
retransmission)
– non-standard protocols can be implemented on top of
UDP
0 16 31
UDP Header
Data
Application Layer
end-to-end
Appl Appl
point-to-point
Link Link Link Link
HTTP message
TCP header
port
HTTP message
IP header
TCP
TCP segment
Ethernet header
IP
IP datagram/packet
Ethernet frame
Adapted from Coulouris, Dollimore and Kindberg
Real-Time Transport Protocol
(RTP)
• Protocol for transport of real-time multi-media
data
– Sequence number
and timestamp in
RTP header
– RTP messages
encapsulated in
UDP datagrams