23
IP Basics

IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

  • View
    221

  • Download
    7

Embed Size (px)

Citation preview

Page 1: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

IP Basics

Page 2: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

IP Basics

• IP encapsulates TCP

• IP packets travel through many different routers (hops) before reaching it’s destination

• MTU variation at the physical layer requires IP to fragment the message into smaller units along the way

• Reassembly is an option at each hop.

• IP does NOT guarantee delivery!

Page 3: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

IP Fragmentation

R R R1000 b 500 b 500 b 250 b 250 b 250 b 250 b

Every link has the potential to dictate adjusting size of frames.

It is possible to reassemble at any point.

R R R1000 b 500 b 500 b 1000 b

Page 4: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

What if frames are lost?

R R250 b 250 b 250 b 250 b1234

ReceiveComputer

Receive computer will hold the first 2 frames awaiting the 3rd.

After a period of time, a timer expires and IP level passes the 500 bytes up and stops looking for the other pieces.

TCP (NOT IP) then will acknowledge receipt of 500 more bytes to the sending TCP layer. If the first frame is lost, NONE are passed up to TCP. More on TCP later.

Page 5: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

IP Frame format(fig 7.33)

VersionHeaderLength

Type ofService

Packet Length

Flags Fragment OffsetIdentification

Time To Live Protocol Checksum

Source IP Address

Destination IP Address

Options

DATA

32 bitsEachline

Page 6: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

Fragmentation and the FrameFig 7.34

4000 byte frame

router

FragId 345FragOffset=0MoreFragments Bit=1Size->1400 byes

FragId 345FragOffset=175MoreFragments Bit=1Size-> 1400 bytes

FragId 345FragOffset=350MoreFragments Bit=0Size->1200 bytes

FragOffset should be multiplied by 8 (8x175=1400)

Page 7: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

IP Summary• Fragmentation results in delivery of frames which

are potentially smaller than the original transmission.

• Some of the frames can be lost• If a message is fragmented and frames are lost, all

frames up to the first lost frame are passed up to the receiving TCP and all subsequent frames are dropped.

• TCP views this as a stream and is unaware of the loss of frames. It just accepts the next “n” bytes, acks the receipt, and waits for subsequent data.

Page 8: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

TCP basics• Connection-oriented

– Sets up the connection prior to data transmission• SYN and 3-way handshake

– Guarantees delivery of data• Sender holds a copy of the data for retransmission if

necessary• Receiver ACKS specific byte positions in the stream so

sender can resend from any byte position

• Encapsulated by IP• Receiver tells sender it’s receive window size

to limit rate of data arrival (flow control)

Page 9: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

Consider How TCP and IP Work Together

Page 10: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

Transport

Network(IP)

Physical

Network(IP)

Physical

1000

1000

2000

Transport

Network(IP)

Physical

2501

500

2502

2503 2504

(Send 2000 bytes)

(ACK 500 bytes)

TCP handling of fragmentation

Up to destination port

Page 11: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

What does the TCP frame look like?

Source Port

Destination Port

Length Checksum

Data

Page 12: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

And after TCP is encapsulated in IP?

IP Header IP Trailer

TCP

Page 13: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

More TCP Issues

Page 14: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

TCP handshake/setup

time

Host A Host B

Ack 0, Syn 1

Ack 1, Syn 0

Ack 1, Syn 1

Ack 1, Syn 0... setup

data

Page 15: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

TCP Framefig 7.43

Source Port Destination Port

Sequence Number

HeaderLength Flags

Acknowledgment Number

Urgent Pointer

Options

DATA

Checksum

Window

Page 16: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

Flow Control w/TCPfig 7.46

Data … s=101, a=701

Data … s=201, a=701

Data … s=701, a=301, c=0

Data … s=801, a=301, c=200

Data … s=401, a=901

Data … s=501, a=901

A B

B says STOP

B says GO(up to 200)

Page 17: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

UDP Issues

Page 18: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

UDP basics• At transport layer as alternative to TCP• No connection establishment• No Guaranteed Delivery• Practically adds nothing to IP• Application must guarantee delivery if

necessary• TCP and timing is hard for you to

implement at the application layer• UDP runs faster if delivery is not required

to be error-free.

Page 19: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

ICMP

Page 20: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

ICMP Basics

• Lower than IP

• A support protocol for routing info/problems

• Doesn’t use ports

• Used in ping

• Frequently used to deny service.. problematic – ping of death (too large message), and– denial of service (ping flood)

physical

IP

TCP/UDP

ICMP

Page 21: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

ICMP Message types

• Echo Request

• Echo Response

• Time Exceeded

• Destination Unreachable

• Redirect

Page 22: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

IP Tunnelling

Transport

(IP)

Physical

Network(IP)

Physical

Appletalk

IntermediateRouters only

See IP

RouterCAN doAT in IP

ReceivingRouter

InsideNetwork

(AT)

ConnectedNetwork

(AT)

Transport

(IP)

Physical

Appletalk

Page 23: IP Basics. IP encapsulates TCP IP packets travel through many different routers (hops) before reaching it’s destination MTU variation at the physical

Transport

(IP)

Physical

Appletalk

IP Tunnelling at one end

Physical

Appletalk

Physical

Appletalk

Appletalk to local Appletalk to non-local

ATIP

ATIP

Route to DestinationAs IP