Title: Lecture 24: TCPIP
1Lecture 24TCP/IP
- Prof. Kenneth M. Mackenzie
- Computer Systems and Networks
- CS2200, Spring 2003
Includes slides from Bill Leahy
2Review IP over any networkEncapsulate the
universal packetsin (any) local network frame
format
Frame Header
Frame Data
3IP Address Hierarchy
- Addresses are broken into a prefix and a suffix
for routing efficiency - The Prefix is uniquely assigned to an individual
network. - The Suffix is uniquely assigned to a host within
a given network
1
1
Network 1
2
Network 2
3
3
5
4Review Name Resolution
- Convert symbolic name to IP address
- People dont like to remember 130.207.5.169
want symbolic names - Solution Domain Name Service (DNS)
- Convert IP address to Ethernet MAC address on
local subnet - Solution Address Resolution Protocol (ARP)
5Review Bootstrapping IP
- To get started you need to know
- Your IP address
- IP address of the router on your subnet
- IP address of a nameserver
- Dont need anything to bootstrap ARP
- Solution DHCP
- Runs on a subnet
- Send an ethernet DHCP request
- Reply contains the three items above
6Short Range Sensor Scan
Today networking cleanup
Thursday RCP and distributed systems
Tuesday guest speakers 3210/3220/3251
Thursday Review
Final 1130-230
7Today
- IP cleanup
- More on addresses
- More on Routing
- Network Example
- TCP
- Reliable in-order streams
- Built atop IP
- Breaking TCP/IP?
8Remember to say
- Project 5 review session this evening
- crucial...
- Project 4 CONTEST!
- fastest multi-CPU and/or multi-disk
configuration? - send your code to kenmac_at_cc.gatech.edu
9IP Addresses
10Special IP Addresses
- Network Address
- Directed Broadcast Address
- Limited Broadcast Address
- This Computer Address
- Loopback Address
- Berkeley Broadcast Address Form
- Local 10..., 192.168..
11Network Address
- Useful to have an address which represents a
network - Formed by adding a 0 suffix
- Example
- 128.10 ? 128.10.0.0
- 10 ? 10.0.0.0
- 192.5.48 ? 192.5.48.0
- A network address should never appear as a
destination in a packet
12Directed Broadcast Address
- Often convenient to send a message to all hosts
on a single network - Directed broadcast address formed by adding a
suffix containing all 1 bits - Once the direct broadcast message arrives in the
destination network it is sent to all host on the
network via - The local networks hardware broadcast facility or
if none present - Individual messages sent to each host
13Limited Broadcast Address
- Typically used on startup by a computer that
doesn't yet know the network number - Message must contain all 1 bits
- Message remains on local net
14This Computer Address
- A computer needs to know its IP address to send
or receive internet packets - TCP/IP contains protocols which allow a computer
to obtain its IP address automatically when it
boots - These startup protocols use IP to communicate
- Sending an IP packet requires a source address
- Address 0.0.0.0 means "this computer"
15Loopback Address
- During testing it is often convenient to have two
applications which will eventually communicate
run on the same computer. - A message can travel down the stack from one
application and back up the stack to the other
application - IP reserves class A network prefix 127 for this
purpose (the suffix doesn't matter) - By convention 127.0.0.1 is most often used
16Berkeley Broadcast Address Form
- UC Berkeley developed and distributed an early
version of TCP/IP as part of BSD UNIX - Instead of a directed broadcast address suffix of
all 1 bits they used a suffix of all 0 bits. This
is known as a Berkley Broadcast - Many early computer manufacturers derived their
software from the Berkeley Implementation - Some can accept either, some both
17Special IP Address Summary
Prefix
Suffix
Type of Address
Purpose
All-0's
All-0's
This computer
Used during bootstarp
Network
All-0's
Network
Identifies a network
Network
all-1's
Directed broadcast
Broadcast on specified net
All-1's
All-1's
Limited broadcast
Broadcast on local net
127
Any
Loopback
Testing
Network
All-0's
Directed broadcast
Berkeley broadcast
10
Any
Local
Unadvertised local
192.168
Any
Local
Unadvertised local
18IP Routing
19Physical Addressing in a WAN
1,2
Switch Site 1
Switch Site 4
A
B
H
1,5
4,2
Switch Site 2
Switch Site 3
Hierarchical Addressing
C
F
E
D
G
2,2
2,6
3,1
3,4
3,7
20Next Hop Forwarding
21Source Independence
- Forwarding is only based on destination
- Example
- Passengers arriving in Atlanta from Boston, Los
Angeles and Midtown all look in one place to find
where to board flight to Miami - Allows compact tables and a single mechanism for
handling forwarding
22Routing
- "Next Hop Information" table is commonly called a
routing table. - Process of forwarding a packet to its next hop is
known as routing. - Hierarchical addressing (i.e. 1,2)
- Computation can be reduced
- Routing table can be made shorter
23Table Size Reduction
Next Hop Information
Destination
Next Hop
1,anything
Int 2
2,anything
Local
3,anything
Int 4
4,anything
Int 3
24Routing in a WAN
- As mentioned key element of WAN is scalability
- Capacity of a WAN may be increased by adding
packet switches (without attached computers) to
the interior of the network - Exterior switches have attched computers
- Interior switches do not
- Each switch must have routing table and be able
to forward packets - Each routing table must be able to handle all
possible addresses - Tables must point to shortest route (Optimal)
25Routing in a WAN
4
1
3
2
26Routing Tables
27Use of Default Routes
Node 1
Node 2
Node 3
Node 4
Dest
Next Hop
Dest
Next Hop
Dest
Next Hop
Dest
Next Hop
1
-
1
(2,1)
3
-
3
(4,3)
(1,2)
2
-
4
(3,4)
4
-
3
(2,3)
(3,2)
(4,2)
4
(2,4)
28Routing Table Computation
- Routing tables are computed automatically
- Two basic approached are used
- Static routing
- Program runs when packet switch boots
- Advantages Simple with low network overhead
- Disadvantage Inflexible
- Dynamic routing
- Program builds routing table on boot and then as
conditions change adjusts table - Advantage Allows network to handle problems
automatically - Disadvantage potentially subject to instability
29Network Example
server
100T switch
desktop
desktop
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
printer
30Network Example
server
100T switch
desktop
192.168.1.254
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
assigned by DHCP from ISP
static picked by DSL modem
printer
31Network Example
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
assigned by DHCP from ISP
static picked by DSL modem
DHCP from DSL modem
static picked by me for the router
printer
32Network Example
192.168.2.200
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
assigned by DHCP from ISP
static picked by DSL modem
DHCP from DSL modem
static picked by me for the router
printer
192.168.2.201
static picked by me
33Network Example
192.168.2.
192.168.2.200
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
assigned by DHCP from ISP
static picked by DSL modem
DHCP from DSL modem
static picked by me for the router
printer
192.168.2.201
DHCP from router
static picked by me
34Network Example
192.168.2.
192.168.2.200
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
printer
192.168.2.201
- One subnet (192.168.2.)
- all use ARP to convert IP-gtMAC
- switches dynamically learn MACs
35Network Example
192.168.2.
192.168.2.200
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
printer
192.168.2.201
Router rules 192.168.2. left 192.168.1.
right all else drop
36Network Example
192.168.2.
192.168.2.200
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
printer
192.168.2.201
- Another subnet
- (192.168.1.)
- use ARP to convert IP-gtMAC
37Network Example
192.168.2.
192.168.2.200
server
100T switch
192.168.1.97
desktop
192.168.1.254
192.168.2.1
desktop
67.33..
10/100 router
DSL modem
ISP
laptop
switch
10T hub
desktop
printer
Another Router. note the DSL link is not
ethernet (also does NAT)
192.168.2.201
38TCP
- (and, by analogy, RDP from PRJ5)
39TCP Reliable Transport Service
- TCP must use an inherently unreliable service,
IP, to provide reliable service - TCP must supply a service that guarantees
- Prompt, reliable communication
- Data delivery in the same order sent
- No loss
- No duplication
40Applications atop IP?
User code 1
User code 2
API
IP code
IP code
41Applications atop IP?
- IP as an API
- send()
- recv() (or upcall)
- oh and btw, messages may disappear, be
duplicated, appear out of order, etc.
User code 1
User code 2
API
IP code
IP code
42Applications atop IP?
- IP as an API
- send()
- recv() (or upcall)
- oh and btw, messages may disappear, be
duplicated, appear out of order, etc.
User code 1
User code 2
API
IP code
IP code
- UDP (Unreliable Datagram Protocol) is a thin
veneer atop IP - Used by some services (NFS, some message
systems) - considered difficult to program!
43Interpose another layer?e.g. RDP or Reliable
Datagram Protocol as in PRJ5?
- RDP API
- send()
- recv() (or upcall)
- Every message sent is received exactly once
User code 1
User code 2
API
RDP
RDP
44Interpose another layer?e.g. RDP or Reliable
Datagram Protocol as in PRJ5?
- RDP API
- send()
- recv() (or upcall)
- Every message sent is received exactly once
User code 1
User code 2
API
send()
RDP
RDP
45Interpose another layer?e.g. RDP or Reliable
Datagram Protocol as in PRJ5?
- RDP API
- send()
- recv() (or upcall)
- Every message sent is received exactly once
User code 1
User code 2
API
send()
RDP
RDP
IP msgs w/RDP data
46Interpose another layer?e.g. RDP or Reliable
Datagram Protocol as in PRJ5?
- RDP API
- send()
- recv() (or upcall)
- Every message sent is received exactly once
User code 1
User code 2
API
send()
recv()
RDP
RDP
IP msgs w/RDP data
IP msg(s) w/ACK
47Services Provided by TCP
- Connection Orientation
- Point-To-Point Communication
- Complete Reliability
- Full Duplex Communication
- Stream Interface
- Reliable Connection Startup
- Graceful Connection Shutdown
48End to End Services
- TCP provides a connection from one application on
a computer to an application on a remote computer - Connection is virtual - provided by software
passing messages - TCP messages are encapsulated in IP Datagrams
- Upon arrival IP passes the TCP message on to the
TCP layer. - TCP exists at both end of the connection but not
at intermediate points (routers).
49Achieving Reliability
- Causes of problems
- Failure of the IP system to deliver information
reliably - Messages may be duplicated, lost, delayed or
delivered out of order - Reboot of a host computer
- Two programs make a connection
- One computer reboots
- New connection is formed
- Messages from first session now arrive
50Packet Loss and Retransmission
- Host 1
- Send message 1
- Start timer
- Receive ack 1
- Send message 2
- Start timer
- Timer expires
- Retransmit message 2
- Start timer
- Receive ack 2
- Host 2
- Receive message 1
- Send ack 1
- Receive message 2
- Send ack 2
Packet Loss
How long to set timer for?
51Adaptive Retransmission
- Whenever TCP sends a message it records the time
and then the time when a response is received - A statistical function is used to maintain a
current estimate of expected delay - Timer can be set to a value depending on
- Stable conditions
- Increasing delay
- Decreasing delay
52Buffers and Windows
- Receiving host can have a buffer
- Acknowledgements can contain amount of free
buffer space available (Window) - Sender will not send more data than buffer will
hold - As buffer space increases (i.e. application
consumes data from buffer) additional acks can be
sent updating buffer space available
53Breaking TCP/IP
- Dont cooperate with congestion control
- ?
54Summary
- IP cleanup
- More on addresses
- More on Routing
- Network Example
- TCP
- Reliable in-order streams
- Built atop IP
- Breaking TCP/IP?