Class Notes for 11/17-11/21
11/17
ICMP Types (Error & Diagnostic)
- Type 4 Source Quench
- Type 11 Time Exceeded
- Type 3 Destination Unreachable
- Type 0 Echo Request/Reply (Ping)
- Type 5 Redirect
- sent by router
- goes to a host in local network
- it is a request for the host to use a different router or to deliver packet directly
Example 1:
128.10.3.0

1.) A wants to send a packet to B, but instead of sending it directly, A sends packet to the router.
2.) Router delivers the packet to B
3.) The router sends an ICMP redirect message telling A to send packets to B directly.
Example 2:

A wants to send a packet to B.
1.) A sends the packet to R1.
2.) R1 sends the packet to R2.
3.) R1 sends ICMP redirect message telling A that to reach B it has to send packets to R2.
- ICMP messages go back to original host.
- There is no ICMP message that is produced by another ICMP message. This is to prevent a cascade of ICMP messages.
Example: Assume a packet where the source and destination addresses are incorrect.
- The router that will deliver the packet sends an ICMP destination unreachable message back to the source because the destination is unreachable.
- The ICMP packet will not be delivered by another router because the initial source was incorrect.
- If we allow ICMP messages caused by ICMP messages, then this packet will bounce infinitely.
- There is no ICMP messages about ICMP messages.
Other Uses of ICMP
Traceroute
- It is a tool to determine the routers needed to reach a host: /usr/local/bin/traceroute www.cnn.com
R1
R2
R3
|
|
- Traceroute works by sending ping with different values of TTL.
- It starts by sending a ping with TTL = 1.

In A > traceroute B
- R1 decrements TTL to 0 and drops packet and sends ICMP time expired.
- A sends ping with TTL = 2.

R2 drops packet and sends ICMP time expired to A. traceroute program prints R2.
- and so on until B receives packet and sends ICMP echo reply to A and traceroute ends.
Path MTU Discovery
Path MTU is the maximum transfer unit in a path of routers where a packet of that size will not be fragmented.

Path MTU = 200
- A sends a small packet (50 bytes) and sets the no fragment bit to 1.
- If A receives a reply it increases the size of packet (100 bytes) and tries again.
- It continues until A receives an ICMP message that packet could not be fragmented. The size of the previous packet will be the Path MTU.
_______________________________________________________________________________________________
11/19
Describe Transport Service
1.) Type of Service
Connection oriented (TCP)
start, maintain, close
Reliable e.g HTTP
Connection-less (UDP)
opposite of connection oriented
e.g. NetPhone, Video
2.) QoS:
1.) Acceptable error/loss levels
2.) Desirable delay
3.) Desirable throughput
4.) Priority level
ftp: -high reliability/throughput
transaction: secure, low delay
3.) Data Transfer:
half duplex A ------------------> B
full duplex A <------------------ B
4.) UI:
Procedure Calls :
Pa --> Pb Pa ---> O ----> Pb (asynchronous)
5.) Connection Management:
A <-------------> B
Who terminates the connection?
6.) Security:
(Alice) -------------------- (Mallory) -------------------- (Bob)
Man-in-the-Middle
IP - unreliable
1.) Ordered Delivery
2.) Retransmission strategy
erroneous/lost
A --------------------> B
ACK
A <-------------------- B Time
|
|
|
\ /
A retransmission timer is set
Two types:
- Fixed timer
- Adaptive Timer
3.) Duplicate Detection
If the packet arrives after it has already been retransmitted and received, packet is dropped.
Connection Establishment
2-Way Handshake
SYN
A -----------> B
ACK
A <----------- B
SYN can get lost (Ignore duplicates)
ACK can get lost (Do the same)
ACK can be delayed (same)
___________________________________________________________________________
11/21
3-Way Handshake
SYN i
A ---------------------------> B
SYN j, ACK i
A <--------------------------- B
SYNi, ACK j
A ---------------------------> B
Delayed SYN, ACK can occur. Those transmissions become obsolete.
Connection Termination: FIN + ACK
FIN
A -----------------> B
TCP - Transmission Control Protocol
- Major transport in Internet
- Heavily used
- Completely reliable transfer
TCP Features
- Connection-oriented service
- Point-to-point
- Full duplex communication
- Stream interface
- Stream divided into segments for transmission
- Each segment encapsulated in IP datagram
- Uses protocol ports to identify applications
TCP Connection:
Source IP, Destination IP, Source porting, Destination porting
Apparent Contradiction
- IP offers best-effort (unreliable) delivery
- TCP uses IP
- TCP provides completely reliable transfer
- How is this possible?
Reliable Data Transmission
- Positive acknowledgement
- Receiver returns short message when data arrives
- Called acknowledgement
- Retransmission
- Traffic conditions change rapidly
- TCP waits for retransmission accordingly
Solving Retransmission Problem
- Adaptive Retransmission
- Timeout depends on current round-trip estimate
Flow Control
- Receiver
- Advertises available buffer space
- Called window
- Sender
- Can send up to entire window before ACK arrives
Startup and Shutdown
- Difficult, Why?
Segments can be
- Lost
- Duplicated
- Delayed
- Delivered out of order
- Either side can crash
- Either side can reboot
- Need to avoid duplicate "shut down" message from affecting later connection
Solution
- Use 3-way handshake
- SYN for startup
- FIN for shutdown
Sequence number specifies where in stream data belongs
Slow Start:
1 Packet
Retransmission Times
2 Packets
4 Packets
2^3, 2^4, ...
If packets drop, indicates maximum ,so decrease when no ACK is received. And then tries to increase. The window size is the upper bound.