i206: Lecture 20:
Networking Standards and
Protocols
Tapan Parikh
Spring 2013
Some slides courtesy Marti Hearst, John Chuang and others
Confidentiality
Distributed
Security Integrity
Systems
Authentication
Network Cryptography …
Network Standards
& Protocols
Inter-process Methodologies/ Principles
Communication TCP/IP,
RSA, … Tools
Operating Application Design Formal models
Process
I/O System
Finite automata
regex
Context switch
Process vs. Thread Program Algorithms Analysis
Locks and deadlocks
Memory Memory ALUs, Registers,
hierarchy Compiler/ Big-O
Program Counter, Assembly
Instruction Register Interpreter
Instructions Data Structures
Register, Cache Searching, sorting,
Main Memory, Encryption, etc.
CPU Machine
Secondary Storage Instructions
Data Op-code, operands
storage Instruction set arch
Stacks, queues,
Circuits maps, trees,
Lossless v. lossy
Info entropy & Decimal, graphs, …
Huffman code Hexadecimal, Adders, decoders,
Binary Memory latches,
Gates ALUs, etc.
Data Number
compression Data Systems
AND, OR, NOT,
Boolean XOR, NAND, NOR,
Logic etc.
Numbers, text,
audio, video,
Truth table
image, … Data Binary Venn Diagram
Representation Numbers Bits & Bytes
DeMorgan’s Law
Lecture Outline
• Different abstractions of a network
• Network architecture
– Layered protocol architecture
– Message encapsulation
Network as Communication
Channel
process p process q
send m receive
Communication channel
Outgoing message buffer Incoming message buffer
Source: Coulouris, Dollimore and Kindberg
Network Cloud
Network
client server
Network: Routers & Links
A
1
B
Hosts
2
3
Links
4
or local
C
networks
5
D
6
E
Routers
Source: Coulouris, Dollimore and Kindberg
Network: More Details
Inter-exchange Customer Premises Internet Service Providers
Carrier (IXC) Long- Telephone Network Internet backbones
Distance
Point of Network Backbone Router
Presence Provider 1
Router
Tandem ISP
Local Switch
Exchange
Carrier Exchange
(LEC) DNS Point
Local Router
Egress
Server
Local
Ingress Switch
Switch Content
Provider
Local Headend
Loop Cable ISP Backbone
Provider 2 Remote ISP
Analog xDSL
Modem Modem Router
router
Cable
Modem Firewall
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
§ An internet: a set of interconnected networks
§ The Internet: the global internetwork based upon the Internet
Protocol (IP)
Network Building Blocks
• Transmission media
– Copper (coax, twisted pair), optical fiber, free
space (wireless)
• Signals
– Electrical currents, light, RF (radio-frequency),
microwave
• Hardware devices
– End hosts, network interfaces
– Routers, switches, hubs, bridges, repeaters
• Software components
– Communication protocol stack
Network Architecture
• Networking can be quite complex and requires a high
degree of cooperation between the involved parties.
• Cooperation is achieved by forcing parties to adhere to
a set of rules and conventions (protocol).
• The complexity of the communication task is reduced by
using multiple protocol layers:
• Each layer is implemented independently.
• Each layer is responsible for a specific subtask.
• Layers are grouped in a hierarchy.
• A structured set of protocols is called a network
architecture, protocol architecture, or protocol suite.
What each layer does
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
ISO/OSI Reference Model TCP/IP Model
The “IP Hourglass”
Application Layer HTTP, FTP, SSH, SMTP,
Your python program, ...
Transport Layer TCP, UDP
A single protocol
Network Layer IP
Data Link Layer Ethernet,
WiFi, SONET
Physical Layer coax, twisted pair, fiber,
wireless, pigeons, ...
TCP/IP Model
end-to-end
Appl Appl
Trans end-to-end Trans
port port
Net Net point-to-point Net Net
work work work work
point-to-point
Link Link Link Link
Host A Router 1 Router 2 Host B
TCP/IP Model (ping)
client server
end-to-end
Appl Appl
Trans end-to-end Trans
port port
Net Net point-to-point Net Net
work work work work
point-to-point
Link Link Link Link
Host A Router 1 Router 2 Host B
Message Flow
Appl Appl
Trans Trans
port port
Net Net Net Net
work work work work
Link Link Link Link
Host A Router 1 Router 2 Host B
Encapsulation
Data
Appl Appl
Data
Trans Trans
port port
Net Net Data Net Net
work work work work
Data
Link Link Link Link
Host A Router 1 Router 2 Host B
Encapsulation
Example: Sending HTTP message using TCP/IP over
Ethernet
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
• Internetworking standards set by IETF
(Internet Engineering Task Force)
• Documented as RFCs (Requests for
Comment):
– RFC 791: IP
– RFC 793: TCP
– RFC 2460: IPv6
– RFC 1034, 1035: DNS
• http://www.ietf.org/rfc.html
Formal Definition of the Internet
• Resolution passed by the Federal Networking Council October
24, 1995
• "Internet" refers to the global information system that --
– (i) is logically linked together by a globally unique address
space based on the Internet Protocol (IP) or its
subsequent extensions/follow-ons;
– (ii) is able to support communications using the
Transmission Control Protocol/Internet Protocol (TCP/IP)
suite or its subsequent extensions/follow-ons, and/or
other IP-compatible protocols; and
– (iii) provides, uses or makes accessible, either publicly or
privately, high level services layered on the
communications and related infrastructure described
herein.
Network Layer
end-to-end
Appl Appl
Trans end-to-end Trans
port port
Net Net point-to-point Net Net
work work work work
point-to-point
Link Link Link Link
Host A Router 1 Router 2 Host B
Internet Protocol (IP)
• Two main functions of network layer:
– Addressing
– Packet switching (routing + packet
forwarding)
• Allow packets to traverse multiple
networks
• Deliver packet to specified destination
host
• Best effort: network delivers packets
as reliably and as quickly as it can (but
provides no guarantee of delivery)
– Routers can and often do drop packets as
part of normal operations
IP Packet Format (v4)
Field length in bits
Bit 0 Bit 31
Version Hdr Len
(4) (4)
TOS (8) Total Length in bytes (16)
Identification (16 bits) Flags (3) Fragment Offset (13)
Heade
Time to Live (8) Protocol (8) Header Checksum (16)
r
Source IP Address (32)
Destination IP Address (32)
Options (if any)
Data
Data (variable length)
IP Address
• Every networked host is identified by its
IP address
• IP (version 4) addresses are 32 bits
long
– 232 = 4,294,967,296 unique IP addresses
• IPv6 addresses are 128 bits long
– 2128 =
340,282,366,920,938,463,463,374,607,431,768,211
,455 unique IP addresses
IP Address: Dotted Decimal
Notation
• Hostname: ischool.berkeley.edu Domain Name
Service (DNS)
• IP address: 128.32.226.87 performs
translation
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
Incoming links Packet Outgoing links
Data Plane
Destination Outgoing
Address Link
w.x.y.z C
Routing table Control Plane
Control plane of a router communicates with its counterparts
at other routers using routing protocols (e.g., RIP, OSPF, BGP)
Transport Layer
end-to-end
Appl Appl
Trans end-to-end Trans
port port
Net Net point-to-point Net Net
work work work work
point-to-point
Link Link Link Link
Host A Router 1 Router 2 Host B
Transmission Control Protocol
(TCP)
• End-to-End reliable data
transport
• Addressing (using ports)
TCP Segment Format
Bit 0 Bit 31
Source Port # (16) Destination Port # (16)
Sequence Number (32 bits)
Heade
Acknowledgement Number (32 bits)
r
Hdr Len
(4)
Reserved (6) Flags (6) Window Size (16)
TCP Checksum (16) Urgent Pointer (16)
Options (if any) Padding
Data
Data (variable length)
Source: Coulouris, Dollimore and Kindberg
TCP Ports socket
any port
agreed port
socket
message
client
server
other ports
Internet address = 138.37.94.248
Internet address = 138.37.88.249
• TCP port number designates
communicating processes
Bit 0 Bit 31
Source Port # (16) Destination Port # (16)
Sequence Number (32 bits)
Acknowledgement Number (32 bits)
Hdr Len
(4)
Reserved (6) Flags (6) Window Size (16)
TCP Checksum (16) Urgent Pointer (16)
Options (if any) Padding
Ports
• The port numbers are divided into three ranges:
– Well known ports (0-1023)
– Registered ports (1024-49151)
– Dynamic and/or private ports (49152 – 65535)
• Some “well known ports”
– ftp (21); ssh (22); telnet (23); smtp (25);
finger (79); http (80)
– assigned by Internet Assigned Numbers
Authority (www.iana.org/numbers.html)
Reliable Delivery?
Process A Process B
Data
Data
Data Packet Loss
Q: how to support reliable data transfer when underlying network is unreliable?
time
Reliable Delivery
• Positive acknowledgment with
retransmission
• Sequence and acknowledgement
numbers
0 16 31
Source Port Number (16) Destination Port Number (16)
TCP Header
Sequence Number (32)
Acknowledgement Number (32)
Hdr Len
Reserved (6) Flags (6) Window Size (16)
(4)
TCP Checksum (16) Urgent Pointer (16)
Options (if any) Padding
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
• Each packet carries acknowledgment of received
packet
– ACK = sequence number of next byte expected by the
receiver
• Lost packet can be detected by missing ACK
• Lost packet can be retransmitted after a timeout
period
ACK and Packet Retransmission
Process A Process B
Data (Seq=x+1)
Data (Ack=x+2)
Data (Seq=x+2) IP loses packet
Timeout
Data (Seq=x+2) TCP resends packet
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
Data (Ack=x+3) IP loses ACK
Data (Seq=x+2) TCP resends packet
TCP resends ACK;
Data (Ack=x+3) drops duplicate
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
Source Port Number (16) Destination Port Number (16)
Message Length (16) UDP Checksum (16)
Data
Application Layer
end-to-end
Appl Appl
Trans end-to-end Trans
port port
Net Net point-to-point Net Net
work work work work
point-to-point
Link Link Link Link
Host A Router 1 Router 2 Host B
Hyper Text Transfer Protocol
(HTTP)
Request line GET /index.html HTTP/1.1<CRLF>
Request header Host: www.ischool.berkeley.edu <CRLF>
Blank line <CRLF>
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
Source: Douglas Comer
Domain Name Service (DNS)
• Routers and end-hosts use IP addresses
– e.g., 128.32.226.87
• Human beings remember hostnames
– e.g., ischool.berkeley.edu
• Need translation service!
• Client sends DNS query message
(hostname) to domain name server
using UDP
• Name server sends DNS response
message (with resolved IP address)
back to client