Académique Documents
Professionnel Documents
Culture Documents
With TCP/IP
Douglas Comer
http://www.cs.purdue.edu/people/comer
COURSE OVERVIEW
AND
INTRODUCTION
d Introduction
d Review of
– Network hardware
– Physical addressing
d Internet model and concept
d Internet (IP) addresses
d Higher-level protocols and the layering principle
d Examples of internet architecture
http://w3c.org
http://www.isoc.org
d Available via
– Email
– FTP
– World Wide Web
http://www.ietf.org/
http://www.isoc.org/ietfreport/
d TCP/IP is vendor-independent
d Standards set by IETF
d Protocol standards found in document series known as
Request For Comments (RFCs)
d Standards found in subset of RFCs labeled STD
REVIEW OF
NETWORK HARDWARE AND
PHYSICAL ADDRESSING
d We will
– Review basic network concepts
– Examine example physical network technologies
– Introduce physical (hardware) addressing
d Connection oriented
d Connectionless
d Paradigm
– Form a ‘‘connection’’ through the network
– Send / receive data over the connection
– Terminate the connection
d Can guarantee bandwidth
d Proponents argue that it works well with real-time
applications
d Example: ATM network
d Paradigm
– Form ‘‘packet’’ of data
– Pass to network
d Each packet travels independently
d Packet includes identification of the destination
d Each packet can be a different size
d The maximum packet size is fixed (some technologies limit
packet sizes to 1,500 octets or less)
d Engineered for
– Low cost
– High capacity
d Direct connection among computers
d Limited distance
d Engineered for
– Long distances
– Indirect interconnection via special-purpose hardware
d Higher cost
d Lower capacity (usually)
End-User Site
MCI Point of Presence
d Extremely popular
d Can run over
– Copper (twisted pair)
– Optical fiber
d Three generations
– 10Base-T operates at 10 Mbps
– 100Base-T (fast Ethernet) operates at 100 Mbps
– 1000Base-T (gigabit Ethernet) operates at 1 Gbps
d IEEE standard is 802.3
02 07 01 00 27 ba 08 00 2b 0d 44 a7 08 00 45 00
00 54 82 68 00 00 f f 01 35 21 80 0a 02 03 80 0a
02 08 08 00 73 0b d4 6d 00 00 04 3b 8c 28 28 20
0d 00 08 09 0a 0b 0c 0d 0e 0 f 10 11 12 13 14 15
16 17 18 19 1a 1b 1c 1d 1e 1 f 20 21 22 23 24 25
26 27 28 29 2a 2b 2c 2d 2e 2 f 30 31 32 33 34 35
36 37
d Known as
– MAC (Media Access Control) address
– Physical address
– Hardware unicast address
d Hardware engineers assign fine distinctions to the above
terms
d We will treat all terms equally
d Sender supplies
– Destination’s address
– Source address (in most technologies)
d Network hardware
– Uses destination address to forward packet
– Delivers packet to proper machine.
d Important note: each technology defines its own addressing
scheme
d Static
– Address assigned by hardware vendor
d Configurable
– Address assigned by customer
d Dynamic
– Address assigned by software at startup
d Electronic device
d Computers connect directly
d Applies bridging algorithm
d Can separate computers onto virtual networks (VLAN
switch)
INTERNETWORKING CONCEPT
AND ARCHITECTURAL MODEL
d Approach 1
– Application gateways
– Gateway forwards data from one network to another
– Example: file transfer gateway
d Approach 2
– Network-level gateways
– Gateway forwards individual packets
d Discussion question: which is better?
d Universal service
d End-to-end connectivity
d Transparency
d Data formats
d Procedures for exchanging information
d Identification
– Services
– Computers
– Applications
d Broad concepts: naming and addressing
Net 1 R Net 2
d Source computer
– Generates a packet
– Sends across one network to a router
d Intermediate router
– Forwards packet to ‘‘next’’ router
d Final router
– Delivers packet to destination
user’s view
d Name
– Identifies what an entity is
– Often textual (e.g., ASCII)
d Address
– Identifies where an entity is located
– Often binary and usually compact
– Sometimes called locator
d Route
– Identifies how to get to the object
– May be distributed
Internetworking With TCP/IP vol 1 -- Part 4 2 2005
Internet Protocol Address
(IP Address)
d Original IP scheme
d Explains many design decisions
d New schemes are backward compatible
0 1 8 16 24 31
Class A 0 netid hostid
0 1 2 3 31
Class D 1 1 1 0 IP multicast
Class E 1 1 1 1 0 reserved
d Computationally efficient
– First bits specify size of prefix / suffix
d Allows mixtures of large and small networks
d All 1’s
d Broadcast limited to local network only (no forwarding)
d Useful for bootstrapping
I1 I2 I3
R A B
I4 I5
NETWORK 2
128 . 10 . 2 . 3
routers
128.210.0.3
To ISP
128.10.0.6 128.10.2.70
WI-FI
128.210.50 NETWORK
128.210.0.0
TALIESYN GLATISANT
(router) (router)
128.210.0.1
ARTHUR
(Wi-Fi
host)
Router to Internet R1
128.10.0.0
R2 R3
192.5.48.0 128.211.0.0
128.211.0.9
H1
Example host
d IP address
– 32 bits long
– Prefix identifies network
– Suffix identifies host
d Classful addressing uses first few bits of address to
determine boundary between prefix and suffix
d Easy to understand
d Efficient
d Only works when hardware address is small
d Technique: assign computer an IP address that encodes the
hardware address
A X B Y
A X B Y
B replies to request
0 8 16 31
d Extract sender’s pair, (IA, EA) and update local ARP table if
it exists
d If this is a request and the target is ‘‘me’’
– Add sender’s pair to ARP table if not present
– Fill in target hardware address
– Exchange sender and target entries
– Set operation to reply
– Send reply back to requester
ARP MESSAGE
INTERNET PROTOCOL:
CONNECTIONLESS DATAGRAM
DELIVERY
APPLICATION SERVICES
d Header contains
– Source Internet address
– Destination Internet address
– Datagram type field
d Payload contains data being carried
0 4 8 16 19 24 31
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
IP HEADER IP DATA
02 07 01 00 27 ba 08 00 2b 0d 44 a7 08 00 45 00
00 54 82 68 00 00 f f 01 35 21 80 0a 02 03 80 0a
02 08 08 00 73 0b d4 6d 00 00 04 3b 8c 28 28 20
0d 00 08 09 0a 0b 0c 0d 0e 0 f 10 11 12 13 14 15
16 17 18 19 1a 1b 1c 1d 1e 1 f 20 21 22 23 24 25
26 27 28 29 2a 2b 2c 2d 2e 2 f 30 31 32 33 34 35
36 37
http://www.blug.linux.no/rfc1149
A Potential Problem
Host Host
A B
Net 1 Net 3
MTU=1500 MTU=1500
Net 2
R1 R2
MTU=620
d Performed by routers
d Divides datagram into several, smaller datagrams called
fragments
d Fragment uses same header format as datagram
d Each fragment forwarded independently
d Seldom used
d Primarily for debugging
d Only some options copied into fragments
d Are variable length
d Note: padding needed because header length measured in
32-bit multiples
d Option starts with option code octet
d Fragmentation
– Needed when datagram larger than MTU
– Usually performed by routers
– Divides datagram into fragments
d Reassembly
– Performed by ultimate destination
– If some fragment(s) do not arrive, datagram discarded
d To accommodate all possible network hardware, IP does not
require reliability (best-effort semantics)
INTERNET PROTOCOL:
FORWARDING IP DATAGRAMS
Answer: YES!
R1 R2
HOST
d Direct delivery
– Ultimate destination can be reached over one network
– The ‘‘last hop’’ along a path
– Also occurs when two communicating hosts both attach
to the same physical network
d Indirect delivery
– Requires intermediary (router)
d General paradigm
– Source host sends to first router
– Each router passes datagram to next router
– Last router along path delivers datagram to destination
host
d Only works if routers cooperate
d Originally
– Routing used to refer to passing datagram from router to
router
d More recently
– Purists decided to use forwarding to refer to the process
of looking up a route and sending a datagram
d But...
– Table is usually called a routing table
TO REACH ROUTE TO
NETWORK THIS ADDRESS
10.0.0.0 / 8 20.0.0.5
40.0.0.0 / 8 30.0.0.7
d Default route
d Host-specific route
ROUTING
FORWARDING
TABLE
ALGORITHM
IP addresses used
DATAGRAM TO BE SENT
PLUS ADDRESS OF NEXT HOP
d Causes include
– Temporary or permanent disconnection
– Hardware failures
– Router overrun
– Routing loops
d Need mechanisms to detect and correct
ICMP MESSAGE
IP HEADER IP DATA
02 07 01 00 27 ba 08 00 2b 0d 44 a7 08 00 45 00
00 54 82 68 00 00 f f 01 35 21 80 0a 02 03 80 0a
02 08 08 00 73 0b d4 6d 00 00 04 3b 8c 28 28 20
0d 00 08 09 0a 0b 0c 0d 0e 0 f 10 11 12 13 14 15
16 17 18 19 1a 1b 1c 1d 1e 1 f 20 21 22 23 24 25
26 27 28 29 2a 2b 2c 2d 2e 2 f 30 31 32 33 34 35
36 37
Type Field
222222222222 ICMP Message Type
22222222222222222222222222222
30 Traceroute
31 Datagram Conversion Error
32 Mobile Host Redirect
33 IPv6 Where-Are-You
34 IPv6 I-Am-Here
35 Mobile Registration Request
36 Mobile Registration Reply
37 Domain Name Request
38 Domain Name Reply
39 SKIP
40 Photuris
OPTIONAL DATA
...
...
...
R2
R3
R1 R5
S D
R4
...
d ICMP
– Required part of IP
– Used to report errors to original source
– Reporting only: no interaction or error correction
d Several ICMP message types, each with its own format
d ICMP message begins with 1-octet TYPE field
d ICMP encapsulated in IP for delivery
INTERNET PROTOCOL:
CLASSLESS AND SUBNET
ADDRESS EXTENSIONS
(CIDR)
d Division into prefix and suffix means: site can assign and
use IP addresses in unusual ways provided
– All hosts and routers at the site honor the site’s scheme
– Other sites on the Internet can treat addresses as a
network prefix and a host suffix
d Proxy ARP
d Subnet addressing
d Layer 2 solution
d Allow two physical networks to share a single IP prefix
d Arrange special system to answer ARP requests and forward
datagrams between networks
Hidden Network
d Chief advantages
– Transparent to hosts
– No change in IP routing tables
d Chief disadvantages
– Does not generalize to complex topology
– Only works on networks that use ARP
– Most proxy ARP systems require manual configuration
128.10.1.1 128.10.1.2
H1 H2
REST OF THE
R
INTERNET
Network 128.10.2.0
128.10.2.1 128.10.2.2
all traffic to H3 H4
128.10.0.0
Internet local
part part
.. .. ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
.. .. ..
. . .
Internet physical
host
part network
Note: in this case, 16-bit host portion is divided into two 8-bit
fields
To rest of Internet
R1
Network 1
R2 R3
Network 2 Network 3
R4 R5
Network 4 Network 5
Router at site R1
128.10.1.0
R2 R3
128.10.2.0 128.10.3.0
d Same value!
d Same value!
R1 H R2
Net 2 (subnet of address N) Net 3 (subnet of address N)
128.10.0.0 128.211.0.0
default 128.211.0.100 2
(b)
d Problem
– Continued exponential Internet growth
– Subnetting insufficient
– Limited IP addresses (esp. Class B)
d Dire prediction made in 1993:
d Solution to problem
– Temporary fix until next generation of IP
– Backward compatible with classful addressing
– Extend variable-length subnet technology to prefixes
d CIDR was predicted to work ‘‘for a few years’’
– Extremely successful!
– Will work for at least 25 years!
0 1
0 1 0
0 1 1
0 1 0 1
0 1
PROTOCOL LAYERING
Sender Receiver
Layer n Layer n
... ...
Layer 2 Layer 2
Layer 1 Layer 1
Network
Internet
IP Module
Protocol Layer
Network
Interface Layer Interface 1 Interface 2 Interface 3
(a) (b)
Sender Receiver
other... other...
Layer Functionality
7 Application
6 Presentation
5 Session
4 Transport
3 Network
Data Link
2 (Hardware Interface)
Physical Hardware
1 Connection
Application
Messages or Streams
Transport
Transport Protocol Packets
Internet
IP Datagrams
Network Interface
... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... Network-Specific Frames
.. ..
.. ..
.. Hardware ..
.. .
..........................................
d Protocol is IP
d Provides machine to machine communication
d Defines best-effort, connectionless datagram delivery service
for the Internet
d Code is usually in the operating system
Host A Host B
Application Application
identical
message
Transport Transport
identical
packet
Internet Internet
identical
datagram
Network Network
Interface identical Interface
frame
Physical Net
Host A Host B
identical
Application Application
message
identical
Transport Transport
packet
Router R
Internet IP Module
Network
Interface Interface 1 Interface 2 Interface 3
Point-To-Point
Intranet
(Intranet)
(a) (b)
Application
Software outside the operating system
Software inside the operating system
Transport
Internet
Only IP addresses used
Network Physical addresses used
Interface
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ..
.. ...
.. ..
.. Hardware ..
..
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...
Demultiplexing Based
On Frame Type
Frame Arrives
IP Module
Datagram Arrives
TCP Module
Segment Arrives
d Layering
– Intended for designers
– Helps control complexity in protocol design
d TCP/IP uses 5-layer reference model
d Conceptually, a router only needs layers 2 and 3, and a host
needs all layers
d IP is machine-to-machine protocol
d TCP is end-to-end protocol
d Demultiplexing used to handle multiple protocols at each
layer
0 16 31
DATA
...
0 8 16 31
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
Conceptual Layering
Application
Internet (IP)
Network Interface
UDP
HEADER UDP DATA AREA
IP
HEADER IP DATA AREA
FRAME
HEADER FRAME DATA AREA
UDP: Demultiplexing
Based On Port
IP Module
d Stream orientation
d Virtual circuit connection
d Buffered transfer
d Unstructured stream
d Full duplex connection
d Reliability
Send Packet 1
Receive Packet 1
Send ACK 1
Receive ACK 1
Send Packet 2
Receive Packet 2
Send ACK 2
Receive ACK 2
Packet lost
Send Packet 1
Start Timer
Packet should arrive
ACK should be sent
ACK would normally
arrive at this time
Timer Expires
Retransmit Packet 1
Start Timer
Receive Packet 1
Send ACK 1
Receive ACK 1
Cancel Timer
initial window
1 2 3 4 5 6 7 8 9 10 . . .
(a)
window slides
1 2 3 4 5 6 7 8 9 10 . . .
(b)
Send Packet 1
Receive Packet 1
Send Packet 2 Send ACK 1
Receive Packet 2
Send Packet 3 Send ACK 2
Receive ACK 2
Receive ACK 3
Conceptual Layering
Application
Internet (IP)
Network Interface
0 4 10 16 24 31
SEQUENCE NUMBER
ACKNOWLEDGEMENT NUMBER
. . .
0 8 16 31
SOURCE IP ADDRESS
DESTINATION IP ADDRESS
d Example: α = .8, β = .2
d Large α makes estimate less susceptible to a single long
delay (more stable)
d Large β makes estimate track changes in round-trip time
quickly
100
.. .... . .. .
.... .. . .... .....
.. .. . .. ..
. .. . .... . ...
.... .. .. ... .
.. ... . .
.... .. .. . .
80 . . . . .
.
.. ..
. .
. .
... . . ...... ....
. . ... .. .
60 . . .... .... ...
.... . ... ..
.. .. ..... ..
.. ..
. ... . ...
.
... .. .. . ......
40 . . ..
. ....... . . ..
... .......
20
12 s
10 s
x... x .x.
... .. ..
x . .
8s . .
x..x. .. ..
. . x..
. .. .
. .
. . .
. .. .
. .
. .. .
. .
.
. x... .
.
.
.
x
.. .
.
.
6s
.
.
. x... .
.
. . x. ..
. .
. .
. .
.
. x.. ... ..
. .
. .... ..
Time x..x.x.x... x
. .
.
.
.
.
.
.
. x
.x
.
. . .
.. .. ..
.
. .
. x.. .. .
. .
.
x. .. .. .. ..
. .
. . .
.
. .
.
. x
. . . x. . .
. .. .. .. .. .
. . . x .x
.x.x
. .. . . .. x .x
.. .. .. ..
4s .
. . . .
x.. x... x.x.x.. x
. . .. ..
x.. .... . .
. x... . . ..
x
.x
.
. x..x... x. . . x.. .. .. ..
. . . . .. x. .. . . . . . .. x. .. .. . .
.
. x... x
. .. .. . .. .. x . .
. . ... .. .
.
. . .x
. . . ..
. . . . .. .. .. x .. . . . x . .. x
.
.
.. x
.
. .
. .. . .. . .
.
x. .
. .
.
x
.
. .
. .. .. .
.
. x.x.. .. .. .. .. . .. . .. .. . x
. . . x .
.
. .. x .. x
. . .. .. . . . x . .
. x
. x
. .
. .. . .
. .. x.
. .
.
.
. . . .
. .. x.. x
. . x . x
. ... .. x. x
. x
. x .. . .
. ..
. x.. .
. x
. .
. x
.
.. .
x. . ..
.. . .x
x.. x..
.
. x
.
. .. x.. .. x.x.. .. x..
2s x.x.
.. ..
.. ..
x.x. . x
. ... .. x
.
.. ..
. .. . x. .x
.
.x
. . . . .. x .. x
.
x.x x..
x. . . ...
x .
1 10 20 30 40 50 60 70 80 90 100
Datagram Number
12 s
10 s
x... x .x.
... .. ..
x . .
8s . .
x..x. .. ..
. . x..
. .. .
. .
. . .
. .. .
. .
. .. .
. .
.
. x... .
.
.
.
x
.. .
.
.
6s
.
.
. x... .
.
. . x. ..
. .
. .
. .
.
. x.. ... ..
. .
. .... ..
Time x..x.x.x... x
. .
.
.
.
.
.
.
. x
.x
.
. . .
.. .. ..
.
. .
. x.. .. .
. .
.
x. .. .. .. ..
. .
. . .
.
. .
.
. x
. . . x. . .
. .. .. .. .. .
. . . x .x
.x.x
. .. . . .. x .x
.. .. .. ..
4s .
. . . .
x.. x... x.x.x.. x
. . .. ..
x.. .... . .
. x... . . ..
x
.x
.
. x..x... x. . . x.. .. .. ..
. . . . .. x. .. . . . . . .. x. .. .. . .
.
. x... x
. .. .. . .. .. x . .
. . ... .. .
.
. . .x
. . . ..
. . . . .. .. .. x .. . . . x . .. x
.
.
.. x
.
. .
. .. . .. . .
.
x. .
. .
.
x
.
. .
. .. .. .
.
. x.x.. .. .. .. .. . .. . .. .. . x
. . . x .
.
. .. x .. x
. . .. .. . . . x . .
. x
. x
. .
. .. . .
. .. x.
. .
.
.
. . . .
. .. x.. x
. . x . x
. ... .. x. x
. x
. x .. . .
. ..
. x.. .
. x
. .
. x
.
.. .
x. . ..
.. . .x
x.. x..
.
. x
.
. .. x.. .. x.x.. .. x..
2s x.x.
.. ..
.. ..
x.x. . x
. ... .. x
.
.. ..
. .. . x. .x
.
.x
. . . . .. x .. x
.
x.x x..
x. . . ...
x .
1 10 20 30 40 50 60 70 80 90 100
Datagram Number
begin CLOSED
Internet (IP)
Network Interface
unreliable reliable
checksum optional checksum required
connectionless connection-oriented
record boundaries stream interface
intended for LAN useful over WAN or LAN
no flow control flow control
1-to-1, 1-many, many-1 1-to-1
allows unicast, multicast unicast only
or broadcast
ARPANET BACKBONE
Core
R1 R2 ... Rn
Routers
BACKBONE
...
R1 R2 ... Rn
L1
Ln L2
.
.
.
CORE
L7 SYSTEM
L3
L6 L4
L5
R1 R2 R3
(a) (b)
d Alternative to distance-vector
d Distributed computation
– Broadcast information
– Allow each router to compute shortest paths
d Avoids problem where one router can damage the entire
internet by passing incorrect information
d Also called Shortest Path First (SPF)
participating participating
router R3 router
non-participating
router
INTERNET BACKBONE
Participating
R1
Router
Local Net 1
R2 R3
Common
an EGP used Network
R1 R2
0 16 24 31
MARKER
LENGTH TYPE
0 8 16 31
VERSION
HOLD TIME
BGP IDENTIFIER
PARM. LEN
0 16 31
WITHDRAWN LEN
PATH LEN
0 8 31
LEN
Net 5
R1 R2 Runs BGP
R3
Net 1 Net 2
Net 3
R4
Net 4
ROUTING: INSIDE AN
AUTONOMOUS SYSTEM
(RIP, OSPF, HELLO)
d Static routes
– Initialized at startup
– Never change
– Typical for host
– Sometimes used for router
d Dynamic router
– Initialized at startup
– Updated by route propagation protocols
– Typical for router
– Sometimes used in host
Internetworking With TCP/IP vol 1 -- Part 15 2 2005
Illustration Of Topology In Which
Static Routing Is Optimal
Net 1
R1
Net 2
R2
Net 3
R3 R4
Net 4 Net 5
Net 1
R1
Net 2
R2 R5
Net 3
R3 R4
Net 4 Net 5
IGP1 IGP2
BGP used
R1 R2
IGP1 IGP2
d RIP
d HELLO
d OSPF
d Active
– Form used by routers
– Broadcasts routing updates periodically
– Uses incoming messages to update routes
d Passive
– Form used by hosts
– Uses incoming messages to update routes
– Does not send updates
128.10.0.200 128.10.0.209
128.10.0.0
...
d Host listens for RIP broadcast and uses data to update table
d Eliminates ICMP redirects
Network
R1 R2 R3
N
Network
R1 R2 R3
N
Network
R1 R2 R3
N
DISTANCE TO NETWORK 1
DISTANCE TO NETWORK 2
...
NET 1 IP ADDRESS
DISTANCE TO NETWORK 1
NET 2 IP ADDRESS
DISTANCE TO NETWORK 2
...
d Hops
– Zero-origin
– One-origin (e.g., RIP)
d Delay
d Throughput
d Jitter
0 8 16 24 31
AREA ID
Type Meaning
222222222222222222222222222222222222222
1 Hello (used to test reachability)
2 Database description (topology)
3 Link status request
4 Link status update
5 Link status acknowledgement
0 8 16 24 31
NETWORK MASK
DESIGNATED ROUTER
NEIGHBOR1 IP ADDRESS
NEIGHBOR2 IP ADDRESS
...
NEIGHBORn IP ADDRESS
0 8 16 24 29 31
MUST BE ZERO I M S
LINK TYPE
LINK ID
ADVERTISING ROUTER
...
0 16 31
LINK TYPE
LINK ID
ADVERTISING ROUTER
...
0 16 31
...
0 16 31
LINK ID
ADVERTISING ROUTER
INTERNET MULTICASTING
d Form of broadcast
d Only one copy of a packet traverses the net
d NIC initially configured to accept packets destined to
– Computer’s unicast address
– Hardware broadcast address
d User can dynamically add (and later remove)
– One or more multicast addresses
01.00.00.00.00.0016
1 1 1 0 Group Identification
d Two types
– Well-known (address reserved for specific protocol)
– Transient (allocated as needed)
d Address range
d Notes
– 224.0.0.0 is reserved (never used)
– 224.0.0.1 is ‘‘all systems’’
– 224.0.0.3 is ‘‘all routers’’
– Address up through 224.0.0.255 used for multicast
routing protocols
Address Meaning
2 22222222222222222222222222222222222222222
224.0.0.0 Base Address (Reserved)
224.0.0.1 All Systems on this Subnet
224.0.0.2 All Routers on this Subnet
224.0.0.3 Unassigned
224.0.0.4 DVMRP Routers
224.0.0.5 OSPFIGP All Routers
224.0.0.6 OSPFIGP Designated Routers
224.0.0.7 ST Routers
224.0.0.8 ST Hosts
224.0.0.9 RIP2 Routers
224.0.0.10 IGRP Routers
224.0.0.11 Mobile-Agents
224.0.0.12 DHCP Server / Relay Agent
224.0.0.13 All PIM Routers
224.0.0.14 RSVP-Encapsulation
224.0.0.15 All-CBT-Routers
224.0.0.16 Designated-Sbm
224.0.0.17 All-Sbms
224.0.0.18 VRRP
Address Meaning
2 22222222222222222222222222222222222222222222222222222
224.0.0.19
through Other Link Local Addresses
224.0.0.255
224.0.1.0
through Globally Scoped Addresses
238.255.255.255
239.0.0.0
through Scope restricted to one organization
239.255.255.255
01.00.5E.00.00.0016
01.00.5E.00.00.0216
Level Meaning
22222222222222222222222222222222222222222222222222222
0 Host can neither send nor receive IP multicast
1 Host can send but not receive IP multicast
2 Host can both send and receive IP multicast
0 8 16 31
network 1
R B C D E
network 3
network 2
F G
network 1
R1 R2
A
network 2 network 3
R3 R4
network 4
d Early form
d Routers flood datagrams initially
d Flooding pruned as group membership information learned
d Early protocol
d Defines extension of IGMP that routers use to exchange
multicast routing information
d Implemented by Unix mrouted program
– Configures tables in kernel
– Supports tunneling
– Used in Internet’s Multicast backBONE (MBONE)
net 1 net 2
INTERNET
R1 (with no support R2
for multicast)
DATAGRAM
MULTICAST DATAGRAM DATA AREA
HEADER
DATAGRAM
UNICAST DATAGRAM DATA AREA
HEADER
d IP travels in IP
d Proposed protocol
d Better for sparse network
d Does not forward to a net until host on the net joins a group
d Request to join a group sent to ‘‘core’’ of network
d Multiple cores used for large Internet
0
S1
0
1 S3
0
(a)
label action
0 send out interface 1
1 send out interface 1
2 send out interface 0
3 send out interface 1
..
.
(b)
0
S0 S1
0
0
1 S3
d Faster forwarding
d Aggregated route information
d Ability to manage aggregate flows
d Datagram classified
– Multiple headers examined
– Example: classification can depend on TCP port
numbers as well as IP addresses
d Classification used to assign a label
d Note: each label corresponds to ‘‘flow’’ that may include
may TCP sessions
DATAGRAM
DATAGRAM DATA AREA
HEADER
FRAME
FRAME DATA AREA
HEADER
d Shim header
– Prepended to IP datagram
– Only used while datagram in MPLS core
d MPLS switches use LABEL in shim when forwarding
packet
d Found in NHLFT
d Specifies
– Next hop information (e.g., the outgoing interface)
– Operation to be performed
– Encapsulation to use (optional)
– How to encode the label (optional)
– Other information needed to handle the packet (optional)
d Outgoing
– MPLS prepends shim header to each datagram
– If datagram fills network MTU, fragmentation will be
required
d Incoming
– Classification requires knowledge of headers (e.g., TCP
port numbers)
– Only first fragment contains needed information
– LSR must collect fragments and reassemble before
classification
MOBILE IP
CARE-OF ADDRESSES
Bit Meaning
22222222222222222222222222222222222222222222222222222222222222
0 Registration with an agent is required; co-located
care-of addressing is not permitted
1 The agent is busy and is not accepting registrations
2 Agent functions as a home agent
3 Agent functions as a foreign agent
4 Agent uses minimal encapsulation
5 Agent uses GRE-style encapsulation
6 Agent supports header compression when communicating
with mobile
7 Unused (must be zero)
0 8 16 31
HOME ADDRESS
HOME AGENT
CARE-OF ADDRESS
IDENTIFICATION
EXTENSIONS . . .
Bit Meaning
22222222222222222222222222222222222222222222222222222222
0 This is a simultaneous (additional) address
rather than a replacement.
1 Mobile requests home agent to tunnel a copy of
each broadcast datagram
2 Mobile is using a co-located care-of address and
will decapsulate datagrams itself
3 Mobile requests agent to use minimal encapsulation
4 Mobile requests agent to use GRE encapsulation
5 Mobile requests header compression
6-7 Reserved (must be zero)
R2 INTERNET R3
D
R1 destination R4
home agent
foreign agent
Site 1 Site 2
INTERNET
R1 R3
128.10.1.0 192.5.48.0
leased circuit
R2 R4
128.10.2.0 128.210.0.0
DATAGRAM
OUTER DATAGRAM DATA AREA
HEADER
Site 1 Site 2
INTERNET
R1 R3
128.10.1.0 192.5.48.0
destination next hop
R2 R4
128.10.1.0 direct
128.10.2.0 128.210.0.0
128.10.2.0 R2
192.5.48.0 tunnel to R3
128.210.0.0 tunnel to R3
default ISP’s router
Routing table in R1
d Extension to IP addressing
d IP-level access to the Internet through a single IP address
d Transparent to both ends
d Implementation
– Typically software
– Usually installed in IP router
– Special-purpose hardware for highest speed
d Organization
– Obtains one globally valid address per Internet
connection
– Assigns nonroutable addresses internally (net 10)
– Runs NAT software in router connecting to Internet
d NAT
– Replaces source address in outgoing datagram
– Replaces destination address in incoming datagram
– Also handles higher layer protocols (e.g., pseudo header
for TCP or UDP)
hosts using
INTERNET dialup access
d NAT must
– Change IP headers
– Possibly change TCP or UDP source ports
– Recompute TCP or UDP checksums
– Translate ICMP messages
– Translate port numbers in an FTP session
CLIENT-SERVER MODEL
OF INTERACTION
d Client
– Any application program
– Contacts a server
– Forms and sends a request
– Awaits a response
d Server
– Usually a specialized program that offers a service
– Awaits a request
– Computes an answer
– Issues a response
.. ..
request sent to
... ...
. well-known port .
client server
.. ..
request sent to
... ...
. well-known port .
client server
.. ..
response sent to
... ...
. client’s port .
client server
d TCP/IP standards
– Describe general functionality needed
– Do not give details such as function names and
arguments
d Each OS free to define its own API
d In practice: socket interface has become de facto standard
API
close(socket)
0 16 31
0 16 31
IP ADDRESS
d Note
– Function write can also be used
– Alternatives exist for connectionless transport (UDP)
d Note
– Function read can also be used
– Alternatives exist for connectionless transport (UDP)
listen(socket, qlength)
d Note:
– Original socket remains available for accepting
connections
– New socket corresponds to one connection
– Permits server to handle requests concurrently
d Server
– Creates socket for each service
– Calls select function to wait for any request
– Select specifies which service was contacted
d Form of select
System Calls In
Computer’s Operating System
localshort = ntohs(netshort)
locallong = ntohl(netlong)
netshort = htons(localshort)
netlong = htonl(locallong)
address = inet_addr(string)
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
/*----------------------------------------------------------------------
* Program: whoisclient
*
* Purpose: UNIX application program that becomes a client for the
* Internet "whois" service.
*
* Use: whois hostname username
*
* Author: Barry Shein, Boston University
*
* Date: Long ago in a universe far, far away
*
*----------------------------------------------------------------------
*/
myname = argv[0];
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <pwd.h>
/*----------------------------------------------------------------------
* Program: whoisserver
*
* Purpose: UNIX application program that acts as a server for
* the "whois" service on the local machine. It listens
* on well-known WHOIS port (43) and answers queries from
* clients. This program requires super-user privilege to
* run.
*
* Use: whois hostname username
*
main(argc, argv)
int argc; /* standard UNIX argument declarations */
char *argv[];
{
int s, t; /* socket descriptors */
int i; /* general purpose integer */
struct sockaddr_in sa, isa; /* Internet socket address structure */
struct hostent *hp; /* result of host name lookup */
char *myname; /* pointer to name of this program */
struct servent *sp; /* result of service lookup */
char localhost[MAXHOSTNAME+1];/* local host name as character string */
/*
* Get one line request
*/
if( (i = read(sock, buf, BUFSIZ)) <= 0)
return;
buf[i] = ’\0’; /* Null terminate */
d Socket API
– Invented for BSD Unix
– Not official part of TCP/IP
– De facto standard in the industry
– Used with TCP or UDP
– Large set of functions
d General paradigm: create socket and then use a set of
functions to specify details
d Needed by ISPs
– Client obtains an IP address and uses temporarily
– When client finishes, address is available for another
client
d Also used on many corporate networks
/ DHCPDISCOVER
Lease Reaches
DHCPOFFER 87.5% Expiration /
DHCPREQUEST
REBIND RENEW
Select Offer /
DHCPREQUEST
DHCPACK
REQUEST DHCPACK
Lease Reaches
50% Expiration /
DHCPACK DHCPREQUEST
BOUND
Cancel Lease / DHCPRELEASE
TRANSACTION ID
SECONDS FLAGS
CLIENT IP ADDRESS
YOUR IP ADDRESS
SERVER IP ADDRESS
ROUTER IP ADDRESS
OPTIONS (VARIABLE)
.
.
.
0 8 16 23
d Two possibilities
– According to network topology
– By organizational structure (independent of physical
networks)
d Internet uses the latter
d Flexible hierarchy
– Universal naming scheme (same everywhere)
– Each organization determines internal naming structure
d Mechanism known as Domain Name System (DNS)
d Name assigned to a computer known as domain name
cs . purdue . edu
unnamed root
cc cs ecn reston
cnri
A given name may map to more than one item in the domain
system. The client specifies the type of object desired when
resolving a name, and the server returns objects of that type.
Root
Server
d Facts
– Most lookups refer to local names
– Name-to-address bindings change infrequently
– User is likely to repeat same lookup
d To increase efficiency
– Initial contact begins with local name server
– Every server caches answers (owner specifies cache
timeout)
0 16 31
IDENTIFICATION PARAMETER
QUESTION SECTION
...
ANSWER SECTION
...
AUTHORITY SECTION
...
0 16 31
0 16 31
TYPE CLASS
TIME TO LIVE
RESOURCE DATA
...
The Domain Name System only maps full domain names into
addresses; abbreviations are not part of the Domain Name
System itself, but are introduced by client software to make
local names convenient for users.
APPLICATIONS:
REMOTE LOGIN
(TELNET AND RLOGIN)
d Client
– Invoked by user
– Forms connection to remote server
– Passes keystrokes from user’s keyboard to server and
displays output from server on user’s screen
d Server
– Accepts connection over the network
– Passes incoming characters to OS as if they were typed
on a local keyboard
– Sends output over connection to client
server sends to
pseudo terminal
telnet telnet
client reads client sends appl.
from keyboard client to server server
user’s
keyboard TCP connection across internet Server’s
& display Client Server
System
Client System format used NVT format used Server System format used
ASCII Decimal
Control Code Value Assigned Meaning
222222222222222222222222222222222222222222222222222222222222222222222222222222222222
NUL 0 No operation (has no effect on output)
BEL 7 Sound audible/visible signal (no motion)
BS 8 Move left one character position
HT 9 Move right to the next horizontal tab stop
LF 10 Move down (vertically) to the next line
VT 11 Move down to the next vertical tab stop
FF 12 Move to the top of the next page
CR 13 Move to the left margin on the current line
other control – No operation (has no effect on output)
Signal Meaning
222222222222222222222222222222222222222222222222222222222
IP Interrupt Process (terminate running program)
AO Abort Output (discard any buffered output)
AYT Are You There (test if server is responding)
EC Erase Character (delete the previous character)
EL Erase Line (delete the entire current line)
SYNCH Synchronize (clear data path until TCP urgent
data point, but do interpret commands)
BRK Break (break key or attention signal)
Decimal
Command Encoding Meaning
222222222222222222222222222222222222222222222222222222222222222222222222222222222222
IAC 255 Interpret next octet as command (when the IAC
octet appears as data, the sender doubles it
and sends the 2-octet sequence IAC-IAC)
DON’T 254 Denial of request to perform specified option
DO 253 Approval to allow specified option
WON’T 252 Refusal to perform specified option
WILL 251 Agreement to perform specified option
SB 250 Start of option subnegotiation
GA 249 The ‘‘go ahead’’ signal
EL 248 The ‘‘erase line’’ signal
EC 247 The ‘‘erase character’’ signal
AYT 246 The ‘‘are you there’’ signal
AO 245 The ‘‘abort output’’ signal
IP 244 The ‘‘interrupt process’’ signal
BRK 243 The ‘‘break’’ signal
DMARK 242 The data stream portion of a SYNCH (always
accompanied by TCP Urgent notification)
NOP 241 No operation
SE 240 End of option subnegotiation
EOR 239 End of record
d Similar to rlogin
d Also part of BSD Unix
d Allows remote execution of a single command
d Alternative to TELNET/rlogin
d Transport layer protocol with service authentication
d User authentication protocol
d Connection protocol
– Multiplexes multiple transfers
– Uses encryption for privacy
APPLICATIONS:
FILE TRANSFER AND ACCESS
(FTP, TFTP, NFS)
TCP/IP
internet
d For data transfer, client side becomes server and server side
becomes client
d Client
– Creates process to handle data transfer
– Allocates port and sends number to server over control
connection
– Process waits for contact
d Server
– Receives request
– Creates process to handle data transfer
– Process contacts client-side
Internetworking With TCP/IP vol 1 -- Part 25 7 2005
Question For Discussion
d Login anonymous
d Password guest
d Used for ‘‘open’’ FTP site (where all files are publicly
available
d Typically used by browsers
d Alternative to FTP
d Whole-file copying
d Not as much functionality as FTP
d Code is much smaller
d Intended for use on Local Area Network
d Runs over UDP
d Diskless machine can use to obtain image at bootstrap
application
local
NFS
file
client
system
APPLICATIONS:
ELECTRONIC MAIL
(SMTP, POP, IMAP, MIME)
user
inter-
face
( mailbox, computer )
d Powerful idea
d Email arriving on a computer can be forwarded to an
ultimate destination
alias
database
user
inter-
face
mailbox@computer
d Message consists of
– Header
– Blank line
– Body of message
d Headers have form
keyword : information
d Application-level protocol
d Uses TCP
d Commands and responses encoded in ASCII
From: bill@acollege.edu
To: john@example.com
MIME-Version: 1.0
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
APPLICATIONS:
WORLD WIDE WEB
(HTTP)
d Application level
d Request / response paradigm
d Stateless
d Permits bi-directional transfer
d Offers capability negotiation
d Support for caching
d Support for intermediaries
Header Meaning
222222222222222222222222222222222222222222222222
Content-Length Size of item in octets
Content-Type Type of item
Content-Encoding Encoding used for item
Content-Language Language(s) used in item
Content-Length: 34
Content-Language: english
Content-Encoding: ascii
Connection: close
Accept-Encoding:
Accept-Charset:
Accept-Language:
APPLICATIONS:
VOICE AND VIDEO OVER IP
(VOIP, RTP, RSVP)
d Internet standard
d Provides playback timestamp along with data
d Allows receiver to playback items in sequence
TIMESTAMP
CONTRIBUTING SOURCE ID
...
Type Meaning
222222222222222222222222222222222222
200 Sender report
201 Receiver report
202 Source description message
203 Bye message
204 Application specific message
d H.323
d SIP
d ITU standard
d Set of many protocols
d Major protocols specified by H.323 include
Protocol Purpose
2222222222222222222222222222222222222222222222222222222
H.225.0 Signaling used to establish a call
H.245 Control and feedback during the call
RTP Real-time data transfer (sequence and timing)
T.120 Exchange of data associated with a call
UDP TCP
IP
d IETF standard
d Alternative to H.323
– Less functionality
– Much smaller
d Permits SIP telephone to make call
d Does not require RTP for encoding
d Companion to SIP
d Specifies details such as
– Media encoding
– Protocol port numbers
– Multicast addresses
d RSVP defines
– Messages endpoint sends to router to request QoS
– Messages routers send to other routers
– Replies
d RSVP does not specify how enforcement done
d Separate protocol needed
APPLICATIONS:
INTERNET MANAGEMENT
(SNMP)
MA
MA MA
MC
MA MA
Manager’s Host
Other devices
d Agent
– Runs on arbitrary system (e.g., a router)
– Responds to manager’s requests
d Management software
– Runs on manager’s workstation
– Sends requests to agents as directed by the manager
d ISO standard
d Specifies
– Syntax for names (user-readable format)
– Binary encoding (format used in a message)
d Absolute, global, hierarchical namespace
unnamed
joint-
iso itu iso-itu
1 2 3
org
3
dod
6
internet
1
mib
1
1.3.6.1.2.1
internet
1
mib
1
inter- addr.
system faces trans. ip icmp tcp udp
1 2 3 4 5 6 7
d Numeric value is
1.3.6.1.2.1.4.3
Command Meaning
222222222222222222222222222222222222222222222222222222222222222
get-request Fetch a value from a specific variable
get-next-request Fetch a value without knowing its exact name
get-bulk-request Fetch a large volume of data (e.g., a table)
response A response to any of the above requests
set-request Store a value in a specific variable
inform-request Reference to third-part data (e.g., for a proxy)
snmpv2-trap Reply triggered by an event
report Undefined at present
SNMPv3Message ::=
SEQUENCE {
msgVersion INTEGER (0..2147483647),
-- note: version number 3 is used for SNMPv3
msgGlobalData HeaderData,
msgSecurityParameters OCTET STRING,
msgData ScopedPduData
}
INTERNET SECURITY
AND FIREWALL DESIGN
(IPsec, SSL)
d Data integrity
d Data availability
d Privacy or confidentiality
d Authorization
d Authentication
d Replay avoidance
d Especially difficult
d Data travels across many networks owned by many groups
from source to destination
d Computers in the middle can change data
d Encryption
d Perimeter Security
d Devised by IETF
d Actually a set of protocols
d Name IPsec applies collectively
d Works with IPv4 or IPv6
d Gives framework, but does not specify exactly which
encryption or authentication algorithms to use
d Choice between authentication and encryption
d Not an IP option
d Added after IP header
d Follows IPv6 format (more on IPv6 later in the course)
(a)
(b)
0 8 16 31
SEQUENCE NUMBER
(a)
authenticated
encrypted
(b)
0 16 31
SEQUENCE NUMBER
d Eight octets
d Precedes payload
0 16 24 31
(a)
authenticated
encrypted
(b)
Authentication
2 222222222222222222222222222222222222
HMAC with MD5 RFC 2403
HMAC with SHA-1 RFC 2404
d Created by IETF
d So closely related to SSL that the same protocol port is used
d Most implementations of SSL also support TLS
OUTSIDE 2 R 1 INSIDE
bastion host
GLOBAL
INTRANET
INTERNET
(INSIDE)
(OUTSIDE)
manually enabled
bypass
d Connection tracking
– Uses FIN to remove state for TCP connection
– Does not work well with UDP
d Soft state
– Timer set when entry created
– Idle entry removed after timeout
d Developed by IETF
d Started in early 1990s
d Input from many groups, including: computer
manufacturers, hardware and software vendors, users,
managers, programmers, telephone companies, and the cable
television industry
d Larger addresses
d Extended address hierarchy
d Variable header format
d Facilities for many options
d Provision for protocol extension
d Support for autoconfiguration and renumbering
d Support for resource allocation
optional
SOURCE ADDRESS
DESTINATION ADDRESS
Base Header
TCP Segment
NEXT=TCP
(a)
(b)
(c)
d Like IPv4
– Ultimate destination reassembles
d Unlike IPv4
– Routers avoid fragmentation
– Original source must fragment
d Guessing game
d Source sends datagram without fragmenting
d If router cannot forward, router sends back ICMP error
message
d Source tries smaller MTU
0 8 16 29 31
DATAGRAM IDENTIFICATION
d Is fragmentation desirable?
d What are the consequences of the IPv6 design?
104.230.140.100.255.255.255.255.0.0.17.128.150.10.255.255
d Becomes
68E6:8C64:FFFF:FFFF:0:1180:96A:FFFF
FF05:0:0:0:0:0:0:B3
d Becomes
FF05::B3
d Three types
– Unicast (single host receives copy)
– Multicast (set of hosts each receive a copy)
– Anycast (set of hosts, one of which receives a copy)
d Note: no broadcast (but special multicast addresses (e.g.,
‘‘all hosts on local wire’’)
d IPv6 is
– More secure
– Required for mobility
– Better for wireless networks
d IPv6 offers better QoS
d Only IPv6 supports auto-configuration
d IPv6 solves route scaling