ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September...

51
ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006

Transcript of ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September...

Page 1: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

ISO Layer and TCPFundamentals

Rich CarlsonInternet2

eVLBI workshop – TCP FundamentalsSeptember 17, 2006

Page 2: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

2

Outline

• A Brief history of networking

• The OSI reference model

• The TCP/IP architecture

• TCP Fundamentals

Page 3: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

3

Arpanet

• 1962 - ARPA pursues new Interactive Computing paradigm • Focus is on computers as a

communications device• Industry focused on computers as

arithmetic calculators

Page 4: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

4

IMPs & TIPs

• 1969 – A 4 node network is built using Interface Message Processors (IMPs)• UCLA, SRI, UCSB, Univ of Utah

• 1971 – BBN develops a Terminal IPM (TIP) supports up to 64 terminals

Page 5: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

5

The Original Arpanet

Page 6: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

6

Networks Proliferate

• 1974 – BBN opens Telenet

• 1975 – DEC develops DECnet

• 1976 – UUCP (Unix-to-Unix CoPy)

• 1977 – Tymshare opens Tymnet

• 1981 – CUNY develops BITnet

Page 7: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

7

Federal Agencies get in the Act

• ARPA - ARPAnet

• DOE – MFENet and HEPNet created

• NASA – SPAN created

• NSF – CSNet created

Page 8: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

8

ISO OSI networks

International Organization for Standardization (ISO)

• Open Systems Interconnection (OSI)• 1979 - 7 layer reference model defined• 1982 – ISO begins deliberations on specific

protocols for each layer• 1990 – U.S. mandates all gov. purchased

computers must be GOSIP compliant• 1995 – GOSIP requirement rescinded

Page 9: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

9

7 Layer Reference Model

Physical

Data Link

Network

Transport

Session

Presentation

Application

L1

L2

L3

L4

L5

L6

L7

Page 10: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

10

Host – to – Host Communications

Physical

Data Link

Network

Transport

Session

Presentation

Application

Physical

Data Link

Network

Transport

Session

Presentation

Application

Ethernet WiFi

Physical

Network

Data Link

Page 11: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

11

Layer 1 - Physical

• Defines the physical, electrical/optical specifications for each network device• Pin layout• Voltages• Optical levels• Modulation scheme

• Examples:• Ethernet, SONET, FDDI, IEEE 802.11

Page 12: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

12

Layer 2 – Data Link Layer

• Functions and procedures to transmit/receive bits over the physical media.• Media specific addressing• Physical media error detection/recovery• Bridge, Hub, Switch equipment

• Examples:• Ethernet CSMA/CD, HDLC, SDLC

Page 13: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

13

Layer 3 – Network Layer

• Functions and procedures needed to transmit data throughout a global network• Routing functions• Segmentation / reassembly• Global addressing

• Example:• IP addresses

Page 14: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

14

Layer 4 – Transport Layer

• Functions to support the transparent transfer of data between end users• Reliability• Error detection and recovery• Flow control

• Examples:• TCP, UDP, SCTP

Page 15: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

15

Layer 5 – Session Layer

• Control sessions between computers• Establish, maintain, terminate connections• Duplex operation (full or half)• Checkpointing and restart procedures

Page 16: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

16

Layer 6 – Presentation Layer

• Transforms data to/from a common format• Encoding• Compression• Encryption

• Examples:• MIME, XML

Page 17: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

17

Layer 7 – Application Layer

• Program used to interact with computer and data• Specific application for each task• GUI or command line interface

• Examples:• SSH, SCP, HTTP, email

Page 18: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

18

OSI Quick Summary

• OSI reference model defines modular ‘stack’ that allows multi-vendor interoperations.

• Input/output details specified• Internal details left up to individual

vendors• Usually implemented by a series of

function calls

Page 19: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

19

TCP/P Internet

• Direct descendant of ARPAnet • Provides Global packet switched network

services• ‘Standard’ protocol shipped by most

vendors• Still under active development • IPv6• TCP modifications

Page 20: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

20

NCP to TCP transition

• NCP (Network Control Protocol) a host-to-host protocol for the Arpanet• Handled multiple functions

• Separate network and transmission functions into 2 distinct protocols• IP handles addressing and routing functions• TCP handles reliability functions

• 1 year transition period • Flag day specified as 1-Jan-1983

Page 21: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

21

TCP/IP Architecture

Copper, Fiber, Radio

Ethernet, Sonet, ATM

IP

TCP, UDP

Network

Based

Applications

L1

L2

L3

L4

Page 22: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

22

TCP/IP Architecture

Copper, Fiber, Radio

Ethernet, Sonet, ATM

IP

TCP, UDP

Network

Based

Applications

L1

L2

L3

L4

Page 23: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

23

TCP/IP Quick Summary

• Grew out of ARPA funded research program

• Free wide spread deployment in BSD 4.2 OS

• TCP/IP protocols form the Internet

Page 24: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

24

Architecture Comparison

Physical

Data Link

Network

Transport

Session

Presentation

Application

L1

L2

L3

L4

L5

L6

L7

Copper, Fiber, Radio

Ethernet, Sonet, ATM

IP

TCP, UDP

Network

Based

Applications

Page 25: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

25

IP Protocol

• IP is a connectionless datagram delivery service• Unreliable Delivery

• No concept of order• No concept of loss• No concept of late• TTL field to ‘Kill Off’ packets

• Each packet treated separately• Operates over numerous data-link and

physical networks

Page 26: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

26

IP Header Field

• Fixed size header field (20 Bytes), Variable length options

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Version| IHL | DSCP |ECN| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Options | Padding |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Page 27: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

27

IP Address

• 32 bit unsigned number• Network portion used for global routing• Host portion used to identify specific

host

• Usually expressed in “dot quad” format• 192.168.1.1 specifics specific host• 192.168.1.0/24 specifies subnet of hosts

Page 28: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

28

CIDR Rules

• IP address is ANDed with bit mask to extract network portion

• Classless Inter-domain Routing (CIDR)• Specifies length of bit mask

• Example 192.168.2.10/23• C0A8020A + FFFFFE00 = C0A80100• Range is 192.168.1.0 – 192.168.2.255• First and last addresses in subnet are reserved

Page 29: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

29

Network InfrastructureS

witc

h 1

Switch 2 Switch 3

R1

R3

R4

R2R7

R6R9

R8R5

Switch 4

Page 30: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

30

IP Fragmentation

• Routers may break packets into smaller chunks (fragmentation)

• Destination host is responsible for reassembling all fragments into original packet

• Performance impact on modern (ASIC based) routers

Page 31: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

31

IP Don’t Fragment

• Flag in header to indicate that packet should be discarded instead of fragmented

• Basis for Path MTU Discovery protocol • Find the largest packet that can transit the

entire end-to-end path• Router may return an ICMP error message

when it discards the packet• PMTU black holes can occur

Page 32: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

32

TCP Protocol

• TCP provides connection orientated delivery service• Reliable Delivery

• In-order guarantee• Loss detection and recovery• Flow control• Error detection

• Hides network details from applications

Page 33: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

33

TCP Header• Fixed size header field (20 Bytes), Variable length

options 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Source Port | Destination Port |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Sequence Number |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Acknowledgment Number |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Data | |C|E|U|A|P|R|S|F| || Offset|Reserve|W|C|R|C|S|S|Y|I| Window || | |R|E|G|K|H|T|N|N| |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Checksum | Urgent Pointer |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+| Options | Padding |+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Page 34: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

34

TCP Connection Setup

• Host in “Listen” state does passive open

• Host in “Connect” state does active open

• Hosts complete a 3-way handshake to complete open (move to “Established” state

• Full Duplex connection established, hosts can transfer data in either direction

Page 35: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

35

TCP Flow Control

• Original design relied on TCP Window size to control number of packets entering the network

• Real world experience showed that network could experience congestion collapse and new mechanisms were needed • Slow Start after connection is opened

• Exponential Growth algorithm

• Congestion Avoidance once loss is detected• Linear Growth algorithm

Page 36: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

36

TCP Reno

• Most common version of TCP today

• Loss based detection to switch from Slow Start to Congestion Avoidance flow control

• Transmit and Receive windows to guarantee reliability

Page 37: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

37

TCP and RTT / Loss

Speed = [C * Pkt Size]/[RTT * Sqrt(loss)]

Distance RTT (msec)

Loss Speed (Mbps)

LAN 1 1 E-8 82,880.0

Metro 8 1 E-8 10,360.0

Transcontinental 70 1 E-8 1,184.0

Transcontinental 70 1 E-3 3.7

Global 500 1 E-6 16.6Uses standard Ethernet Size TCP segment (1480 bytes)

Formula from Mathis et.al.

Page 38: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

38

TCP and Jumbo Frames

•Speed = [C * Pkt Size]/[RTT * Sqrt(loss)]•Jumbo Frames are a non-standard Ethernet feature

Distance RTT (msec)

Pkt Size (Bytes)

Speed (Mbps)

Transcontinental 70 1500 120.0

Transcontinental 70 9000 720.0

Use 1 E-6 loss rate

Formula from Mathis et.al.

Page 39: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

39

TCP and BDP•TCP uses a sliding Window to maintain reliability• 16 bit header field for supports 64 KB max window size• Window Scale options increases this up to 1 GByte

Distance RTT (msec)

Window (Bytes)

Speed (Mbps)

LAN 1 64K 524.3

Metro 8 64K 65.5

Transcontinental 70 64K 7.5

Transcontinental 70 8M 958.7

Global 500 256K 4.2

Page 40: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

40

TCP modifications

• Most changes to TCP’s Congestion Avoidance growth algorithm• Recognized that linear growth is not

efficient for Fast Long-Distance Paths

Delay Based Detection•Vegas•Fast

Loss Based Detection•Reno•High Speed•BIC, Cubic

Page 41: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

41

TCP Bulk Transfer

http://netflow.internet2.edu/weekly/20060501/#xputs

Page 42: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

42

TCP Behavior due to Loss

Congestion Window Behavior Throughput Behavior

Cwnd (Bytes) vs Time (msec) Speed (Mbps) vs Time (msec)

Page 43: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

43

UDP Protocol

• UDP – User Datagram Protocol• Application must provide

• Reliability• Flow Control

• Useful for short messages• DNS• Real Time audio/video

Page 44: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

44

Domain Name System

• DNS – Domain Name System• Translates Fully Qualified Domain Name

(FQDN) into IP address• A Globally distributed database• Hierarchical naming structure• Supports both Authoritative and Caching

servers• Requires a minimum of 2 packets and 1

RTT for each resolution

Page 45: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

45

Real-time Transport Protocol

• RTP – Real-time Transport Protocol• Carries data with real-time properties• Used for Audio and Video streams• Header contains sequence number and

timestamp to provide receiver with pkt info

• RTCP – RTP Control Protocol• Carries control information about the stream

from receiver back to sender

Page 46: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

46

Unicast vs Multicast

• Unicast packets - 1 source & 1 destination• Multicast packets• IP addresses (224.0.0.0 – 239.255.255.255)• Single source, multiple receivers• Multiple sources, multiple receivers• Routers and Switches must support multicast to

prevent unwanted packets from flooding the network

• Multiple unicast streams can be used to emulate a multicast session

Page 47: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

47

Multicast Traffic

• Source starts sending packets using a multicast IP address

• Local router/switch uses control messages to advertise traffics availability

• Receivers send request-to-join messages

• New path from receiver to “merge point” is created and traffic flow begins

Page 48: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

48

Conclusions

• Global packet switching began with the ARPAnet

• TCP/IP packet switching is the defacto standard for today’s networks• Smart hosts, dumb infrastructure

• New and existing applications support end-to-end communications between people

Page 49: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

49

Page 50: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

50

TCP Behavior due to Loss

Page 51: ISO Layer and TCP Fundamentals Rich Carlson Internet2 eVLBI workshop – TCP Fundamentals September 17, 2006.

51

TCP Throughput with Loss