lecture 3

40
Lecture 3 Review of Internet Protocols Transport Layer

Upload: harlan

Post on 12-Jan-2016

20 views

Category:

Documents


0 download

DESCRIPTION

Lecture 3. Review of Internet Protocols Transport Layer. Protocols: HW/SW Interface. Internetworking : allows computers on independent and incompatible networks to communicate reliably and efficiently; - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture 3

Lecture 3Review of Internet ProtocolsTransport Layer

Page 2: Lecture 3

Protocols: HW/SW InterfaceInternetworking: allows computers on independent and incompatible networks to communicate reliably and efficiently;

Enabling technologies: SW standards that allow reliable communications without reliable networks

Hierarchy of SW layers, giving each layer responsibility for portion of overall communications task, called protocol families or protocol suites

Transmission Control Protocol/Internet Protocol (TCP/IP)This protocol family is the basis of the Internet

IP makes best effort to deliver; TCP guarantees delivery

TCP/IP used even when communicating locally: NFS uses IP even though communicating across homogeneous LAN

2

Page 3: Lecture 3

3

Services provided by layersEach layer in protocol stack provides a “service”

Uses service from lower

layersBenefits of layering

Isolates complexity

Clearly defined interfaces

Protocols implement functionality within layer

Transmission of bits in medium

Point-to-point frame transmission

Connectivity between network interfaces

Process-to-process communication

Application-specific communication

Layered protocol stack

Physical layer

Link layer

Network layer

Transport layer

Application layer

Service provided

Page 4: Lecture 3

DATA

Application

Pre.

Session

Transport

Network

Data Link

Physical

7

6

5

4

3

2

1

DATAAH

DATAPH

DATASH

DATATH

DATANH

DATADH

DATAPH

Application

Pre.

Session

Transport

Network

Data Link

Physical

7

6

5

4

3

2

1

NetworkAB

Layered Network Architecture (OSI)

Page 5: Lecture 3

TCP/IP Model

ISO OSI (Open Systems Interconnection) not fully implemented Presentation and Session layers not present in TCP/IP

Application

Pre.

Session

Transport

Network

Data Link

Physical

7

6

5

4

3

2

1

Application

TCP

IP

Host-to-Net

OSI TCP/IP

Page 6: Lecture 3

6

ProtocolsProtocols define communication between entities

Format and order of messages

Actions taken on transmission and/or receipt of message or other event

Protocols use headers (and trailers) for control information

Naming dependson layer

Data

DataH

DataHH

DataHHH TLink layer

Network layer

Transport layer

Application layer

Frame

Datagram

Segment

Message

Physical layer Bit

Page 7: Lecture 3

7

Process-to-process communication

We have a network. How to get between programs?

Network

Page 8: Lecture 3

8

Process CommunicationHow do the end systems communicate?

Network

Physical layer

Link Layer

Network layer

Transport layer

Application layer

Physical layer

Link Layer

Network layer

Physical layer

Link Layer

Network layer

Transport layer

Application layer

End system End system

Routers

Data

DataH

DataHH

DataHHH T

Data

DataH

DataHH

DataHHH T

DataHHH T

DataHHH T

DataHH

DataHHH T

Page 9: Lecture 3

9

Interface-to-interface connectivityWe now have links. How to get across the network?

Page 10: Lecture 3

10

DatagramsDatagrams are forwarded independently

A

E B

C

F

D

DestOut port

A 3

B 1

... ...

Page 11: Lecture 3

TCP/IP packetApplication sends messageTCP breaks into 64KB segments, adds 20B headerIP adds 20B header, sends to networkIf Ethernet, broken into 1500B packets with headers, trailersHeader, trailers have length field, destination, window number, version, ...

11

TCP data(≤ 64KB)

TCP Header

IP Header

IP Data

Ethernet

Page 12: Lecture 3

12

Communicating with the Server: The O/S Wall

CPU

User

Kernel

NIC NIC

PCI Bus

Problems:• O/S overhead to move a packet between network and application level => Protocol Stack (TCP/IP)

• O/S interrupt • Data copying

from kernel space to user space and vice versa

• Oh, the PCI Bottleneck!

Page 13: Lecture 3

The Send/Receive OperationThe application writes the transmit data to the TCP/IP sockets

interface for transmission in payload sizes ranging from 4 KB to 64

KB.

The data is copied from the User space to the Kernel space

The OS segments the data into maximum transmission unit (MTU)–

size packets, and then adds TCP/IP header information to each

packet.

The OS copies the data onto the network interface card (NIC) send

queue.

The NIC performs the direct memory access (DMA) transfer of each

data packet from the TCP buffer space to the NIC, and interrupts

CPU activities to indicate completion of the transfer.

13

Page 14: Lecture 3

Transmitting data across the memory bus using a standard NIC

14

http://www.dell.com/downloads/global/power/1q04-her.pdf

Page 15: Lecture 3

TCP/IP Processing Path (RX)

Page 16: Lecture 3

Network I/O Processing

10

100

40

GH

z a

nd

Gb

ps

Time1990 1995 2000 2003 2005 2010

.01

0.1

1

10

100

1000

2006/7

Network bandwidth outpaces

Moore’s Law

Moore’s Law

TCP requirements Rule of thumb:1GHz for 1Gbps

Page 17: Lecture 3

I/O Acceleration TechniquesArchitectural ImprovementTCP Offload: Offload TCP/IP Checksum and Segmentation to Interface hardware or programmable device (Ex. TOEs)

O/S Bypass: User-level software techniques to bypass protocol stack – Zero Copy Protocol

(Needs programmable device in the NIC for direct user level memory access – Virtual to Physical Memory Mapping. Ex. VIA)

All the high bandwidth NICs today employ some kind of TCP Offload and O/S Bypass techniques

Page 18: Lecture 3

18

Multiplexing/de-multiplexingMultiple processes operate on one computer

Interface address alone is not sufficient to distinguish

Need to (de)multiplex traffic from different processes

5-tuple used for unique identification of connectionIP source address

IP destination address

Transport layer source port

Transport layer destination port

Transport layer protocol

Page 19: Lecture 3

TCP/IP packet

APP. DATATCPIPMAC MAC

Source Port Destination Port

Sequence Number

Acknowledgement Number

Header Length and Options Window Size

Checksum Urgent Pointer

Options (0 or more 32-bit words)

Page 20: Lecture 3

TCP/IP packet

APP. DATATCPIPMAC MAC

Ver. Total Length

Identification

Time to Live

Source Address

IHL Service Type

Options and Fragment Offset

Protocol Header Checksum

Options (0 or more 32-bit words)

Destination Address

Page 21: Lecture 3

TCP/IP packet

APP. DATATCPIPMAC MAC

Preamble D. Add. S. Add. CRCLeng.

Page 22: Lecture 3

22

TCP Header: 5-tuple example5-tuple is reversed forreturn communication

Destination port isassociated with applicationlayer protocol (e.g., 80for HTTP)

Operating system pickssource port randomly

sender(client)

receiver(server)

128.119.91.53 74.125.39.99

source IP

destination IP

source port

destination port

protocol

128.119.91.53

74.125.39.99

35466

80

TCP

source IP

destination IP

source port

destination port

protocol

128.119.91.53

74.125.39.99

35466

80

TCP

Page 23: Lecture 3

23

TCP headerPort numbers

Sequence number

Position of dataACK number

Next expected data

Checksum

Flags for connection setup and teardown

Source port number

0 7 8 15

16

23

24

313 4 11

12

20

21

28

29

Data offset

Sequence number

Window

Destination port number

Acknowledgement number

Reserved

UR

GA

CK

PS

HR

ST

SY

NF

IN

Checksum Urgent pointer

Options

Data

Page 24: Lecture 3

24

What functionality does TCP provide?

ReliabilityRecovery from errors in the network layer

Flow controlLimit transmission rate to not overwhelm receiver

Congestion controlLimit transmission rate to not overwhelm network

Page 25: Lecture 3

25

Reliable data transferHow can reliability be achieved?

Consider different assumptions for network layer

Case 1: completely reliable network layerSend segment

Case 2: bit errors in network layerAdd error detection and ACK/NAK

Add sequence number to handle garbled ACK/NAK

Case 3: bit errors and packet loss in network layerTimer to trigger retransmission

“Stop-and-wait” protocol

Page 26: Lecture 3

26

Reliable data transferStop-and-wait has low performance

How can we increase throughput?

Sliding windowAllow multiple segments “in-flight”

Page 27: Lecture 3

27

Sliding window example

Sent, acknowledged

Sent, not yet acknowledged

Ready, not yet

sent

Received, acknowledged,

sent to application

Received, acknowledged, not yet sent to

application

Received, not yet

acknowledged

Free buffer

data

acknowledgements

Free buffer

sender receiver

S=1

A=2

S=2S=3

A=4

S=4

S=6S=5

S=7

S=8S=9

S=6S=7

A=6

A=6

A=10

timer for S=6timer for S=7

10987654321 10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

10987654321

1098765432110987654321

1098765432110987654321

10987654321

1098765432110987654321

Sequence numbers Acknowledgement numbers

Page 28: Lecture 3

UDP: bare bones protocolPorts, length, checksum

Checksum is optional

28

Source port number

0 7 8 15 16 23 24 313 4 11 12 20 21 28 29

Length

Destination port number

Checksum

Page 29: Lecture 3

29

Page 30: Lecture 3

Internet ProtocolIP header

Source and destination address

Datagram length

Upper layer protocolIdentifies TCP, UDP, etc.

Time to liveProtection against accidental loops

Header checksumProtection against bit errors

Fragmentation possibleLink layer limited to some datagram size (min. MTU is 576 bytes)

30

Version

0 7 8 15 16 23 24 313 4 11 12 20 21 28 29

Header length

Type of service Datagram length

Identifier Flags Fragment offset

Time to liveUpper layer

protocolHeader checksum

Source address

Destination address

Options

Data

Page 31: Lecture 3

Other IP aspectsRouting

Determines forwarding

ICMPError handling

Link layerAddress resolution (ARP)

Dynamic IP addresses (DHCP)

Application layerDomain names (DNS)

Transport layerNetwork address translation (NAT)

New IP version: IPv631

Physical layer

Link Layer

Network layer

Transport layer

Application layer

Internet Control

Message Protocol (ICMP)

Routing protocols (OSPF, RIP,

BGP)

Address Resolution

Protocol (ARP)

Domain Name System (DNS)

Forwarding Information Base (FIB)

Internet Protocol

(IP)

Page 32: Lecture 3

32

Network systemsData is switched between network stacks

Transport layer

Network layer

Data link layer

Physical layer

Link

...

Transport layer

Network layer

Data link layer

Physical layer

......

Transport layer

Network layer

Data link layer

Physical layer

...

Network system

Link Link

Page 33: Lecture 3

33

Classification of network systemsNetwork system differ by level of protocol processing

Link

Physicalnetworksystem

PhysicalDLC

MAC LLCNetwork Transport ...

PhysicalDLC

MAC LLCNetwork Transport ...

Link

Bridge Router Gateway

Page 34: Lecture 3

34

Example network system: NICNetwork interface card / adapter connects to link

Block diagram:

PhysicalLink MAC DMA

Memory

Micro-processor

End system bus interface

Adapter

Page 35: Lecture 3

35

Example network system: switchSwitch connects multiple links

Block diagram:

Switch

Interconnection

Adapter 1

ProcMemory

DMA

MAC/PHY

Link

Switch

Adapter N

ProcMemory

DMA

MAC/PHY

Link

...

Page 36: Lecture 3

36

Example network system: switchSystem may differ by system architecture

Example: share memory vs. distributed memory

Switch

Interconnection

Adapter 1

Proc

Memory

DMA

MAC/PHY

Link

Switch

Adapter N

Proc

DMA

MAC/PHY

Link

...

Page 37: Lecture 3

37

Application requirementsDifferent applications have different requirements:

Throughput Delay Jitter Packet loss Internet browsing Low Large Insensitive Unacceptable Scientific data archiving High Medium Indifferent Unacceptable Telephony Low Minimal Sensitive Low Internet TV High Minimal Sensitive Low First-person shooter game Low Minimal Very sensitive Unacceptable Real-time surgery High Minimal Very sensitive Unacceptable Delay-tolerant networking Low Large Insensitive Acceptable

Page 38: Lecture 3

38

Throughput preservationThroughput performance

Ensure network system can handle link rates at all points

Delay/jitterEnsure network system processes traffic quickly

Packet lossEnsure sufficient buffer space and fast processing

Most network system design focus on bandwidth

Page 39: Lecture 3

39

Packet rate vs. data rateData rate states total number of bits per second

Each packet requires specific processingPacket rate sometimes more meaningful

What is the packet rate for a 10Gbps link?Distinguish small packets and large packets

Page 40: Lecture 3

40

System design for throughputWhat are the differences between these systems?

How do they affect throughput preservation?

Processor Memory

Bus

Link adapter

Processor Memory

Bus

DMA unitLink

adapter