Ccna Lec2 Physical Datalink Internet Transport

194

Transcript of Ccna Lec2 Physical Datalink Internet Transport

Page 1: Ccna Lec2 Physical Datalink Internet Transport
Page 2: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 2

Page 3: Ccna Lec2 Physical Datalink Internet Transport
Page 4: Ccna Lec2 Physical Datalink Internet Transport
Page 5: Ccna Lec2 Physical Datalink Internet Transport
Page 6: Ccna Lec2 Physical Datalink Internet Transport
Page 7: Ccna Lec2 Physical Datalink Internet Transport
Page 8: Ccna Lec2 Physical Datalink Internet Transport
Page 9: Ccna Lec2 Physical Datalink Internet Transport
Page 10: Ccna Lec2 Physical Datalink Internet Transport
Page 11: Ccna Lec2 Physical Datalink Internet Transport
Page 12: Ccna Lec2 Physical Datalink Internet Transport
Page 13: Ccna Lec2 Physical Datalink Internet Transport
Page 14: Ccna Lec2 Physical Datalink Internet Transport
Page 15: Ccna Lec2 Physical Datalink Internet Transport
Page 16: Ccna Lec2 Physical Datalink Internet Transport
Page 17: Ccna Lec2 Physical Datalink Internet Transport
Page 18: Ccna Lec2 Physical Datalink Internet Transport
Page 19: Ccna Lec2 Physical Datalink Internet Transport

20

Page 20: Ccna Lec2 Physical Datalink Internet Transport

21

Page 21: Ccna Lec2 Physical Datalink Internet Transport
Page 22: Ccna Lec2 Physical Datalink Internet Transport
Page 23: Ccna Lec2 Physical Datalink Internet Transport
Page 24: Ccna Lec2 Physical Datalink Internet Transport
Page 25: Ccna Lec2 Physical Datalink Internet Transport
Page 26: Ccna Lec2 Physical Datalink Internet Transport

• Straight through cable• Cross over cable• Roll over cable

Page 27: Ccna Lec2 Physical Datalink Internet Transport
Page 28: Ccna Lec2 Physical Datalink Internet Transport
Page 29: Ccna Lec2 Physical Datalink Internet Transport
Page 30: Ccna Lec2 Physical Datalink Internet Transport
Page 31: Ccna Lec2 Physical Datalink Internet Transport
Page 32: Ccna Lec2 Physical Datalink Internet Transport
Page 33: Ccna Lec2 Physical Datalink Internet Transport
Page 34: Ccna Lec2 Physical Datalink Internet Transport
Page 35: Ccna Lec2 Physical Datalink Internet Transport
Page 36: Ccna Lec2 Physical Datalink Internet Transport
Page 37: Ccna Lec2 Physical Datalink Internet Transport
Page 38: Ccna Lec2 Physical Datalink Internet Transport
Page 39: Ccna Lec2 Physical Datalink Internet Transport
Page 40: Ccna Lec2 Physical Datalink Internet Transport
Page 41: Ccna Lec2 Physical Datalink Internet Transport
Page 42: Ccna Lec2 Physical Datalink Internet Transport
Page 43: Ccna Lec2 Physical Datalink Internet Transport
Page 44: Ccna Lec2 Physical Datalink Internet Transport
Page 45: Ccna Lec2 Physical Datalink Internet Transport
Page 46: Ccna Lec2 Physical Datalink Internet Transport
Page 47: Ccna Lec2 Physical Datalink Internet Transport
Page 48: Ccna Lec2 Physical Datalink Internet Transport

49

Page 49: Ccna Lec2 Physical Datalink Internet Transport

50

Page 50: Ccna Lec2 Physical Datalink Internet Transport

51

Page 51: Ccna Lec2 Physical Datalink Internet Transport

52

Page 52: Ccna Lec2 Physical Datalink Internet Transport

53

Page 53: Ccna Lec2 Physical Datalink Internet Transport

Connectivity Options• Console• Aux• Telnet

Page 54: Ccna Lec2 Physical Datalink Internet Transport

CONSOLE CONNECTIVITY

Page 55: Ccna Lec2 Physical Datalink Internet Transport

56

AUX CONNECTIVITY

Page 56: Ccna Lec2 Physical Datalink Internet Transport

57

TELNET CONNECTIVITYTelnet is an application for remoteConnectivity. We always telnet anIP Address

Page 57: Ccna Lec2 Physical Datalink Internet Transport

58

Page 58: Ccna Lec2 Physical Datalink Internet Transport

59

Overview of Router Modes

Page 59: Ccna Lec2 Physical Datalink Internet Transport

60

Page 60: Ccna Lec2 Physical Datalink Internet Transport

61

Router Modes

Page 61: Ccna Lec2 Physical Datalink Internet Transport

62

• Show running-config--------------RAM• Show startup-config---------------NVRAM• Show version

– HW– SW– Uptime of the device– Config-register value

• Show ip interface brief• Sh interface ___• Sh controller ___

Page 62: Ccna Lec2 Physical Datalink Internet Transport

63

Page 63: Ccna Lec2 Physical Datalink Internet Transport

64

33*

Page 64: Ccna Lec2 Physical Datalink Internet Transport

65

Page 65: Ccna Lec2 Physical Datalink Internet Transport

66

Page 66: Ccna Lec2 Physical Datalink Internet Transport

--Communication on LAN is faster than communication on WAN--Almost 95 % communication uses MAC while only 5 % uses IP

Page 67: Ccna Lec2 Physical Datalink Internet Transport
Page 68: Ccna Lec2 Physical Datalink Internet Transport
Page 69: Ccna Lec2 Physical Datalink Internet Transport
Page 70: Ccna Lec2 Physical Datalink Internet Transport
Page 71: Ccna Lec2 Physical Datalink Internet Transport
Page 72: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 74

Page 73: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 75

Page 74: Ccna Lec2 Physical Datalink Internet Transport
Page 75: Ccna Lec2 Physical Datalink Internet Transport

77

VERS -- version number HLEN -- header length, in 32-bit words type of service -- how the datagram should be handled total length -- total length (header + data) identification, flags, flag offset -- provides fragmentation of

datagrams to allow differing MTUs in the internetwork

0 15 16 31 4-bit

Version 4-bit

Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP Packet (Data Gram) Header

Page 76: Ccna Lec2 Physical Datalink Internet Transport

78

0 15 16 31 4-bit

Version 4-bit

Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

TTL -- Time-To-Live protocol -- the upper-layer (Layer 4) protocol sending the

datagram header checksum -- an integrity check on the header source IP address and destination IP address -- 32-bit IP

addresses IP options -- network testing, debugging, security, and other

options Data – Upper layer headers and data

IP Packet (Data Gram) Header

Page 77: Ccna Lec2 Physical Datalink Internet Transport
Page 78: Ccna Lec2 Physical Datalink Internet Transport
Page 79: Ccna Lec2 Physical Datalink Internet Transport

81

When a packet is first generated a value is entered into the TTL field.

Originally, the TTL field was the number of seconds, but this was difficult to implement and rarely supported.

Now, the TTL is now set to a specific value which is then decremented by each router.

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP’s TTL – Time To Live field

*

Page 80: Ccna Lec2 Physical Datalink Internet Transport

82

If the router decrements the TTL field to 0, it will then drop the packet (unless the packet is destined specifically for the router, I.e. ping, telnet, etc.).

Common operating system TTL values are:– UNIX: 255– Linux: 64 or 255 depending upon vendor and version– Microsoft Windows 95: 32 – Other Microsoft Windows operating systems: 128

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

IP’s TTL – Time To Live field

Decrement by 1, if 0 drop the packet.

*

Page 81: Ccna Lec2 Physical Datalink Internet Transport

83

TCP/IP Applications PING (Packet Internet Groper) is a diagnostic utility used to

determine whether a computer is properly connected to devices/Internet.

Page 82: Ccna Lec2 Physical Datalink Internet Transport

84

TCP/IP Applications Traceroute is a program that is available on many systems, and

is similar to PING, except that traceroute provides more information than PING. Traceroute traces the path a packet takes to a destination, and is used to debug routing problems.

Page 83: Ccna Lec2 Physical Datalink Internet Transport
Page 84: Ccna Lec2 Physical Datalink Internet Transport
Page 85: Ccna Lec2 Physical Datalink Internet Transport
Page 86: Ccna Lec2 Physical Datalink Internet Transport
Page 87: Ccna Lec2 Physical Datalink Internet Transport
Page 88: Ccna Lec2 Physical Datalink Internet Transport
Page 89: Ccna Lec2 Physical Datalink Internet Transport
Page 90: Ccna Lec2 Physical Datalink Internet Transport
Page 91: Ccna Lec2 Physical Datalink Internet Transport
Page 92: Ccna Lec2 Physical Datalink Internet Transport

TCP

• TCP -- a connection-oriented, reliable protocol; provides flow control by providing sliding windows, and reliability by providing sequence numbers and acknowledgments.

• TCP re-sends anything that is not received and supplies a virtual circuit between end-user applications.

• The advantage of TCP is that it provides guaranteed delivery of the segments.

Page 93: Ccna Lec2 Physical Datalink Internet Transport

95

IP Packet has a Protocol field that specifies whether the segment is TCP or UDP.

Connection-oriented

Connectionless

Connectionless

Page 94: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 96

Page 95: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 97

Page 96: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 98

Page 97: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 99

Page 98: Ccna Lec2 Physical Datalink Internet Transport
Page 99: Ccna Lec2 Physical Datalink Internet Transport
Page 100: Ccna Lec2 Physical Datalink Internet Transport
Page 101: Ccna Lec2 Physical Datalink Internet Transport

103

• The transport layer enables a user's device to segment several upper-layer applications for placement on the same Layer 4 data stream, and enables a receiving device to reassemble the upper-layer application segments.

• The Layer 4 data stream is a logical connection between the endpoints of a network, and provides transport services from a host to a destination.

• This service is sometimes referred to as end-to-end service.

Page 102: Ccna Lec2 Physical Datalink Internet Transport

104

Application Header + data

Application Header + data

IP Protocol Field = 17

IP Protocol Field = 6

Page 103: Ccna Lec2 Physical Datalink Internet Transport

105

The transport layer also provides two protocols• TCP – Transmission Control Protocol• UDP – User Datagram Protocol

Page 104: Ccna Lec2 Physical Datalink Internet Transport

TCP Operation

• IP is best effort delivery.• The transport layer (TCP) is responsible reliability and flow control from

source to destination.• This is accomplished using:

– sliding windows (flow control)– sequencing numbers and acknowledgments (reliability)– synchronization (establish a virtual circuit)

Page 105: Ccna Lec2 Physical Datalink Internet Transport

• IP Packet has a Protocol field that specifies whether the segment is TCP or UDP.

Connection-oriented

Connectionless

Connectionless

TCP OperationIP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

Page 106: Ccna Lec2 Physical Datalink Internet Transport

Application Header + data

Application Header + data

IP Protocol Field = 17

IP Protocol Field = 6

Page 107: Ccna Lec2 Physical Datalink Internet Transport

TCP

• TCP -- a connection-oriented, reliable protocol; provides flow control by providing sliding windows, and reliability by providing sequence numbers and acknowledgments.

• TCP re-sends anything that is not received and supplies a virtual circuit between end-user applications.

• The advantage of TCP is that it provides guaranteed delivery of the segments.

Page 108: Ccna Lec2 Physical Datalink Internet Transport

Synchronization or 3-way handshake

• For a connection to be established, the two end stations must synchronize on each other's initial TCP sequence numbers (ISNs).

• Sequence numbers are used to track the order of packets and to ensure that no packets are lost in transmission.

• The initial sequence number is the starting number used when a TCP connection is established.

• Exchanging beginning sequence numbers during the connection sequence ensures that lost data can be recovered.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 109: Ccna Lec2 Physical Datalink Internet Transport

• Only part of the TCP headers are displayed.

Packet 1: source: 130.57.20.10 dest.:130.57.20.1TCP: ----- TCP header ----- TCP: Source port = 1026 TCP: Destination port = 524 TCP: Initial sequence number = 12952 TCP: Next expected Seq number= 12953 TCP: .... ..1. = SYN TCP: Window = 8192 TCP: Checksum = 1303 (correct) TCP: Maximum segment size = 1460 (TCP Option) Packet 2: source: 130.57.20.1 dest: 130.57.20.10

TCP: ----- TCP header ----- TCP: Source port = 524 TCP: Destination port = 1026 TCP: Initial sequence number = 2744080 TCP: Next expected Seq number= 2744081 TCP: Acknowledgment number = 12953 TCP: .... ..1. = SYN TCP: Window = 32768 TCP: Checksum = D3B7 (correct) TCP: Maximum segment size = 1460 (TCP Option)

Packet 3: source: 130.57.20.10 dest: 130.57.20.1TCP: ----- TCP header ----- TCP: Source port = 1026 TCP: Destination port = 524 TCP: Sequence number = 12953 TCP: Next expected Seq number= 12953 TCP: Acknowledgment number = 2744081 TCP: ...1 .... = Acknowledgment TCP: Window = 8760 TCP: Checksum = 493D (correct) TCP: No TCP options

Page 110: Ccna Lec2 Physical Datalink Internet Transport

Windowing and Window Sizes

• Both of these are example of simple windowing.• This is not an example of sliding windows.• Window size refers to the number of bytes that are transmitted before receiving an

acknowledgment. • After a host transmits the window-size number of bytes, it must receive an

acknowledgment before any more data can be sent. • The window size determines how much data the receiving station can accept at one

time.

Page 111: Ccna Lec2 Physical Datalink Internet Transport

Simple Windowing

• TCP is responsible for breaking data into segments. • With a window size of 1, each segment carries only one byte of data and must

be acknowledged before another segment is transmitted. This results in inefficient host use of bandwidth.

• The purpose of windowing is to improve flow control and reliability. • Unfortunately, with a window size of 1, you see a very inefficient use of

bandwidth.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 112: Ccna Lec2 Physical Datalink Internet Transport

Simple Windowing

TCP Window Size• TCP uses a window size, number of bytes, that the receiver is willing to

accept, and is usually controlled by the receiving process. • TCP uses expectational acknowledgments, meaning that the

acknowledgment number refers to the next byte that the sender of the acknowledgement expects to receive.

• A larger window size allows more data to be transmitted pending acknowledgment.

• Note: The sequence number being sent identifies the first byte of data in that segment.

Page 113: Ccna Lec2 Physical Datalink Internet Transport

Simple Windowing

TCP Full-duplex service: Independent Data Flows• TCP provides full-duplex service, which means data can be flowing in each

direction, independent of the other direction.• Window sizes, sequence numbers and acknowledgment numbers are

independent of each other’s data flow.• Receiver sends acceptable window size to sender during each segment

transmission (flow control) – if too much data being sent, acceptable window size is reduced – if more data can be handled, acceptable window size is increased

• This is known as a Stop-and-Wait windowing protocol.

Page 114: Ccna Lec2 Physical Datalink Internet Transport

Sliding Window Protocol• Sliding window algorithms are a method of flow control for network data transfers

using the receivers Window size.• The sender computes its usable window, which is how much data it can immediately

send.• Over time, this sliding window moves to the right, as the receiver acknowledges data.• The receiver sends acknowledgements as its TCP receive buffer empties.• The terms used to describe the movement of the left and right edges of this sliding

window are: (These will be demonstrated in the following slides.)1. The left edge closes (moves to the right) when data is sent and acknowledged.2. The right edge opens (moves to the right) allowing more data to be sent. This happens

when the receiver acknowledges a certain number of bytes received.3. The middle edge open (moves to the right) as data is sent, but not yet acknowledged.

Octets sent

Not ACKed

Usable Window

Can send ASAP

Working Window sizeUsable Window

Can send ASAP

Initial Window sizeSliding Windows

Page 115: Ccna Lec2 Physical Datalink Internet Transport

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

Host A - Sender Host B - Receiver

Host B gives Host A a window size of 6 (octets or bytes). Host A begins by sending octets to Host B: octets 1, 2, and 3 and slides

it’s window over showing it has sent those 3 octets. Host A will not increase its usable window size by 3, until it receives

an ACKnowldegement from Host B that it has received some or all of the octets.

Host B, not waiting for all of the 6 octets to arrive, after receiving the third octet sends an expectational ACKnowledgement of “4” to Host A.

ACK 4Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6 Octets received

Page 116: Ccna Lec2 Physical Datalink Internet Transport

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

ACK 4

Host A does not have to wait for an acknowldegement from Host B to keep sending data, not until the window size reaches the window size of 6, so it sends octets 4 and 5.

Host A receives the acknowledgement of ACK 4 and can now slide its window over to equal 6 octets, 2 octets sent – not ACKed plus 4 octets which can be sent asap.

45

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

ACK 6

Host B - ReceiverHost A - Sender

Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

Page 117: Ccna Lec2 Physical Datalink Internet Transport

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

ACK 4

45

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

ACK 6

Host B - ReceiverHost A - Sender

Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

1 2 3 4 5 6 7 8 9 10 11 12 13

76

98

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 131 2 3 4 5 6 7 8 9 10 11 12 13

Page 118: Ccna Lec2 Physical Datalink Internet Transport
Page 119: Ccna Lec2 Physical Datalink Internet Transport
Page 120: Ccna Lec2 Physical Datalink Internet Transport

UDP Operation

• UDP does not use windowing or acknowledgments so application layer protocols must provide error detection.

• The Source Port field is an optional field used only if information needs to return to the sending host.

• When a destination router receives a routing update, the source router is not requesting anything so nothing needs to return to the source. – This is regarding only RIP updates.– BGP uses TCP, IGRP is sent directly over IP. EIGRP and OSPF are also sent

directly over IP with their own way of handling reliability.

Page 121: Ccna Lec2 Physical Datalink Internet Transport

UDP Operation

Page 122: Ccna Lec2 Physical Datalink Internet Transport

Port Numbers (TCP and UDP)

Page 123: Ccna Lec2 Physical Datalink Internet Transport

Rick Graziani [email protected] 125

Page 124: Ccna Lec2 Physical Datalink Internet Transport

Application Header + data

Application Header + data

Port numbers are used to know which application the receiving host should pass the “Data” to.

Port Numbers

Page 125: Ccna Lec2 Physical Datalink Internet Transport

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

IP Header 0 15 16 31

4-bit Version

4-bit Header Length

8-bit Type Of Service (TOS)

16-bit Total Length (in bytes)

16-bit Identification

3-bit Flags

13-bit Fragment Offset

8 bit Time To Live

TTL

8-bit Protocol

16-bit Header Checksum

32-bit Source IP Address

32-bit Destination IP Address

Options (if any)

Data

Page 126: Ccna Lec2 Physical Datalink Internet Transport

• Application software developers have agreed to use the well-known port numbers that are defined in RFC 1700.

• For example, any conversation bound for an Telnet application uses the standard port number 23.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP HeaderPort Numbers

Page 127: Ccna Lec2 Physical Datalink Internet Transport

• Conversations that do not involve an application with a well-known port number are, instead, assigned port numbers that are randomly selected from within a specific range.

• These port numbers are used as source and destination addresses in the TCP segment.

• Some ports are reserved in both TCP and UDP, although applications might not be written to support them.

• (Curriculum) Port numbers have the following assigned ranges:– Numbers below 255 are reserved for public applications – Numbers from 255-1023 are assigned to companies for marketable applications – Numbers above 1023 are unregulated

• (RFC) The range for assigned ports managed by the IANA is 0-1023.: http://www.iana.org/assignments/port-numbers– The Well Known Ports are those from 0 through 1023. (This is updated

information as of 11-13-2002. Before then, 0 – 255 were considered well known ports.)

– The Registered Ports are those from 1024 through 49151 – The Dynamic and/or Private Ports are those from 49152 through 65535

Port Numbers

Page 128: Ccna Lec2 Physical Datalink Internet Transport

• End systems use port numbers to select the proper application. • Originating source port numbers, usually a value larger than 1023, are

dynamically assigned by the source host.

TCP Header0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP HeaderPort Numbers

Page 129: Ccna Lec2 Physical Datalink Internet Transport

Notice the difference in how source and destination port numbers are used with clients and servers:

Client:• Destination Port = 23 (telnet)• Source Port = 1028 (dynamically assigned)

Server:• Destination Port = 1028 (source port of client)• Source Port = 23 (telnet)

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 130: Ccna Lec2 Physical Datalink Internet Transport

1031

Second http session between the same client and server. Same destination port, but different source port to uniquely identify this web session.

80801030

http to www.cisco.com

http to www.cisco.com

Dest. Port = 80 Send packets to web server application

Dest. Port = 80 Send packets to web server application

This example shows two separate browser windows to the same URL. TCP/IP uses source port numbers to know which information goes to which window.

Page 131: Ccna Lec2 Physical Datalink Internet Transport

What makes each connection unique?• Connection defined by the pair of numbers:

– source IP address, source port– destination IP address, destination port

• Different connections can use the same destination port on server host as long as the source ports or source IPs are different.

Page 132: Ccna Lec2 Physical Datalink Internet Transport

• Note: In actuality, when you open up a single web page, there are usually several TCP sessions created, not just one.

• Example of multiple TCP connections for a single http session.

www.cisco.com

Source IPTCP or UDP

Source PortDestination IP

Destination Port

Connection State

netstat command

Page 133: Ccna Lec2 Physical Datalink Internet Transport

135

Sliding Window Protocol Sliding window algorithms are a method of flow control for

network data transfers using the receivers Window size. The sender computes its usable window, which is how much data

it can immediately send. Over time, this sliding window moves to the rights, as the receiver

acknowledges data. The receiver sends acknowledgements as its TCP receive buffer

empties. The terms used to describe the movement of the left and right

edges of this sliding window are:1. The left edge closes (moves to the right) when data is sent and

acknowledged.2. The right edge opens (moves to the right) allowing more data to

be sent. This happens when the receiver acknowledges a certain number of bytes received.

3. The middle edge open (moves to the right) as data is sent, but not yet acknowledged.

*

Octets sent

Not ACKed

Usable Window

Can send ASAP

Working Window sizeUsable Window

Can send ASAP

Initial Window size

Page 134: Ccna Lec2 Physical Datalink Internet Transport

136

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

Host A - Sender Host B - Receiver

Host B gives Host A a window size of 6 (octets). Host A begins by sending octets to Host B: octets 1, 2, and 3 and

slides it’s window over showing it has sent those 3 octets. Host A will not increase its usable window size by 3, until it

receives an ACKnowldegement from Host B that it has received some or all of the octets.

Host B, not waiting for all of the 6 octets to arrive, after receiving the third octet sends an expectational ACKnowledgement of “4” to Host A.

ACK 4Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

*

Octets received

Page 135: Ccna Lec2 Physical Datalink Internet Transport

137

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

ACK 4

Host A does not have to wait for an acknowldegement from Host B to keep sending data, not until the window size reaches the window size of 6, so it sends octets 4 and 5.

Host A receives the acknowledgement of ACK 4 and can now slide its window over to equal 6 octets, 3 octets sent – not ACKed plus 3 octets which can be sent asap.

45

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

ACK 6

Host B - ReceiverHost A - Sender

*

Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

Page 136: Ccna Lec2 Physical Datalink Internet Transport

138

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

ACK 4

More sliding windows

45

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

ACK 6

Host B - ReceiverHost A - Sender

*

Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

1 2 3 4 5 6 7 8 9 10 11 12 13

76

98

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 131 2 3 4 5 6 7 8 9 10 11 12 13

Page 137: Ccna Lec2 Physical Datalink Internet Transport

139

TCP Features

Guarantees reliable, in order delivery of bytes Flow control mechanism Supports multiplexing Congestion control

Flow control prevents the sender from over flowing the receiver.

Congestion Control prevents too much data from being injected into the network

Page 138: Ccna Lec2 Physical Datalink Internet Transport

140

For a connection to be established, the two end stations must synchronize on each other's initial TCP sequence numbers (ISNs).

Sequence numbers are used to track the order of packets and to ensure that no packets are lost in transmission.

The initial sequence number is the starting number used when a TCP connection is established.

Exchanging beginning sequence numbers during the connection sequence ensures that lost data can be recovered.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 139: Ccna Lec2 Physical Datalink Internet Transport
Page 140: Ccna Lec2 Physical Datalink Internet Transport
Page 141: Ccna Lec2 Physical Datalink Internet Transport
Page 142: Ccna Lec2 Physical Datalink Internet Transport
Page 143: Ccna Lec2 Physical Datalink Internet Transport
Page 144: Ccna Lec2 Physical Datalink Internet Transport
Page 145: Ccna Lec2 Physical Datalink Internet Transport
Page 146: Ccna Lec2 Physical Datalink Internet Transport
Page 147: Ccna Lec2 Physical Datalink Internet Transport
Page 148: Ccna Lec2 Physical Datalink Internet Transport
Page 149: Ccna Lec2 Physical Datalink Internet Transport
Page 150: Ccna Lec2 Physical Datalink Internet Transport
Page 151: Ccna Lec2 Physical Datalink Internet Transport
Page 152: Ccna Lec2 Physical Datalink Internet Transport
Page 153: Ccna Lec2 Physical Datalink Internet Transport
Page 154: Ccna Lec2 Physical Datalink Internet Transport
Page 155: Ccna Lec2 Physical Datalink Internet Transport
Page 156: Ccna Lec2 Physical Datalink Internet Transport
Page 157: Ccna Lec2 Physical Datalink Internet Transport
Page 158: Ccna Lec2 Physical Datalink Internet Transport
Page 159: Ccna Lec2 Physical Datalink Internet Transport
Page 160: Ccna Lec2 Physical Datalink Internet Transport

162

TCP Features

Guarantees reliable, in order delivery of bytes Flow control mechanism Supports multiplexing Congestion control

Flow control prevents the sender from over flowing the receiver.

Congestion Control prevents too much data from being injected into the network

Page 161: Ccna Lec2 Physical Datalink Internet Transport

163

TCP supports logical connections between processes that are running on two end systems over the internet

This means that TCP needs an explicit establishment phase during which time the two sides of connection agree to exchange data & also a teardown phase.

Page 162: Ccna Lec2 Physical Datalink Internet Transport

164

TCP are likely to have widely different RTT (round trip times)

ie two pc’s connected across a room rrt =1mS two pc’s connected across internet rrt = 100mS

So timeout mechanism’s need to be adaptive.

Page 163: Ccna Lec2 Physical Datalink Internet Transport

165

TCP has no control over the route that packets may take over a connection.

Therefore packets may need to be re-ordered. The question is how far out of

order can packets get before they are seen as lost.

Page 164: Ccna Lec2 Physical Datalink Internet Transport

166

Delay * Bandwidth product

Obviously TCP connections across the internet are highly variable, therefore TCP must have a mechanism for learning what resources are available and how much buffer space is required.

ie Flow control

Page 165: Ccna Lec2 Physical Datalink Internet Transport

167

Congestion

The Transmitting side of the link cannot transmit faster than the bandwidth of the link allows, and does not know what link will be used further down the link.

This lead to congestion, discussed in Quality of Service issues.

Page 166: Ccna Lec2 Physical Datalink Internet Transport

168

TCP breaks data stream into segments

Page 167: Ccna Lec2 Physical Datalink Internet Transport

169

TCP -- a connection-oriented, reliable protocol; provides flow control by providing sliding windows, and reliability by providing sequence numbers and acknowledgments.

TCP re-sends anything that is not received and supplies a virtual circuit between end-user applications.

The advantage of TCP is that it provides guaranteed delivery of the segments.

TCP

Page 168: Ccna Lec2 Physical Datalink Internet Transport

170

TCP Segment Header0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

Some of the protocols that use TCP are: http telnet FTP

Page 169: Ccna Lec2 Physical Datalink Internet Transport

171

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

source port -- the number of the calling port destination port -- the number of the called port sequence number -- the number used to ensure correct sequencing of the

arriving data acknowledgment number -- the next expected TCP octet HLEN -- the number of 32-bit words in the header reserved -- set to 0 code bits -- the control functions (e.g. setup and termination of a session) window -- the number of octets that the sender is willing to accept checksum -- the calculated checksum of the header and data fields urgent pointer -- indicates the end of the urgent data option -- one currently defined: maximum TCP segment size data -- upper-layer protocol data

TCP Segment Header

Page 170: Ccna Lec2 Physical Datalink Internet Transport

172

UDP Segment Header0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

16-bit UDP Length

16-bit UDP Checksum

Data (if any)

UDP -- connectionless and unreliable; although responsible for transmitting messages, no software checking for segment delivery is provided at this layer.

The advantage that UDP provides is speed. Since UDP provides no acknowledgments, less traffic is sent

across the network, making the transfer faster. Protocols that use UDP include the following:

– TFTP – SNMP – Network File System (NFS) – Domain Name System (DNS)

Page 171: Ccna Lec2 Physical Datalink Internet Transport

173

source port -- the number of the calling port destination port -- the number of the called port UDP length -- the length of the UDP header checksum -- the calculated checksum of the header and data

fields data -- upper-layer protocol data

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

16-bit UDP Length

16-bit UDP Checksum

Data (if any)

UDP Segment Header

Page 172: Ccna Lec2 Physical Datalink Internet Transport

174

Both TCP and UDP use ports (or sockets) numbers to pass information to the upper layers.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 173: Ccna Lec2 Physical Datalink Internet Transport

175

Application Header + data

Application Header + data

Port numbers are used to know which application

the receiving host should send the “Data” to.

Port numbers are used to know which application

the receiving host should send the “Data” to.

*

Page 174: Ccna Lec2 Physical Datalink Internet Transport

176

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Some ports are reserved in both TCP and UDP, although applications might not be written to support them.

The range for assigned ports managed by the IANA is 0-1023.: http://www.iana.org/assignments/port-numbers– The Well Known Ports are those from 0 through 1023. (This is

updated information as of 11-13-2002. Before then, 0 – 255 were considered well known ports.)

– The Registered Ports are those from 1024 through 49151 – The Dynamic and/or Private Ports are those from 49152 through

65535

Page 175: Ccna Lec2 Physical Datalink Internet Transport

177

End systems use port numbers to select the proper application.

Originating source port numbers, usually some numbers larger than 1023, are dynamically assigned by the source host.

TCP Header0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 176: Ccna Lec2 Physical Datalink Internet Transport

178

Notice the difference in how source and destination port numbers are used with clients and servers:

Client: Destination Port = 23 (telnet) Source Port = 1028 (dynamically assigned)

Server: Destination Port = 1028 (source port of client) Source Port = 23 (telnet)*

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 177: Ccna Lec2 Physical Datalink Internet Transport

179

1031

Second http session from the between the same client and server. Same destination port, but different source port to uniquely identify this web session.

80801030

http to www.cisco.com

http to www.cisco.com

Dest. Port = 80 Send packets to web server application

Dest. Port = 80 Send packets to web server application

This example shows two separate browser windows to the same URL. TCP/IP uses source port numbers to know which information goes to which window. *

Page 178: Ccna Lec2 Physical Datalink Internet Transport

180

What makes each connection unique? Connection defined by the pair of numbers: source IP address, source port destination IP address, destination port Different connections can use the same destination port on server

host as long as the source ports or source IPs are different.*

Page 179: Ccna Lec2 Physical Datalink Internet Transport

181

For a connection to be established, the two end stations must synchronize on each other's initial TCP sequence numbers (ISNs).

Sequence numbers are used to track the order of packets and to ensure that no packets are lost in transmission.

The initial sequence number is the starting number used when a TCP connection is established.

Exchanging beginning sequence numbers during the connection sequence ensures that lost data can be recovered.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 180: Ccna Lec2 Physical Datalink Internet Transport

182

Synchronization is accomplished by exchanging segments carrying the ISNs and a control bit called SYN, which stands for synchronize. (Segments carrying the SYN bit are also called SYNs.)

Successful connection requires a suitable mechanism for choosing an initial sequence and a slightly involved handshake to exchange the ISNs.

Synchronization requires that each side send its own ISN and receive a confirmation and ISN from the other side of the connection.

Each side must receive the other side's ISN and send a confirming acknowledgment (ACK) in a specific order.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 181: Ccna Lec2 Physical Datalink Internet Transport

183

Because the second and third steps can be combined in a single message, the exchange is called a three-way handshake/open connection.

A three-way handshake is necessary because TCPs may use different mechanisms for picking the ISN.

The receiver of the first SYN has no way of knowing if the segment was an old delayed one unless it remembers the last sequence number used on the connection, which is not always possible, and so it must ask the sender to verify this SYN

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 182: Ccna Lec2 Physical Datalink Internet Transport

184

At this point, either side can begin communicating, and either side can break the communication because TCP is a peer-to-peer (balanced) communication method.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 183: Ccna Lec2 Physical Datalink Internet Transport

185

To govern the flow of data between devices, TCP uses a peer-to-peer flow control mechanism.

The receiving host's TCP layer reports a window size to the sending host's TCP layer.

This window size specifies the number of bytes, starting with the acknowledgment number, that the receiving host's TCP layer is currently prepared to receive.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 184: Ccna Lec2 Physical Datalink Internet Transport

186

Window size refers to the number of bytes that are transmitted before receiving an acknowledgment.

After a host transmits the window-size number of bytes, it must receive an acknowledgment before any more data can be sent.

The window size determines how much data the receiving station can accept at one time.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 185: Ccna Lec2 Physical Datalink Internet Transport

187

With a window size of 1, each segment carries only one byte of data and must be acknowledged before another segment is transmitted. This results in inefficient host use of bandwidth.

The purpose of windowing is to improve flow control and reliability.

Unfortunately, with a window size of 1, you see a very inefficient use of bandwidth.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

Page 186: Ccna Lec2 Physical Datalink Internet Transport

188

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

*

TCP Window Size TCP uses a window size, number of bytes, that the receiver is

willing to accept, and is usually controlled by the receiving process.

TCP uses expectational acknowledgments, meaning that the acknowledgment number refers to the next byte that the sender of the acknowledgement expects to receive.

A larger window size allows more data to be transmitted pending acknowledgment.

Note: The sequence number being sent identifies the first byte of data in that segment.

Page 187: Ccna Lec2 Physical Datalink Internet Transport

189

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

*

TCP Window Size TCP provides full-duplex service, which means data can be

flowing in each direction, independent of the other direction. Window sizes, sequence numbers and acknowledgment

numbers are independent of each other’s data flow. Receiver sends acceptable window size to sender during each

segment transmission (flow control) – if too much data being sent, acceptable window size is reduced – if more data can be handled, acceptable window size is increased

This is known as a Stop-and-Wait windowing protocol.

Page 188: Ccna Lec2 Physical Datalink Internet Transport

190*

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

Packets may be dropped along the way, timed out, or corrupted. TCP does not currently use selective acknowledgements (SACK). There is currently no way of acknowledging selected pieces of the

data stream. If octets 4, 5, and 6 were sent, but 5 was lost, the receiver would

only acknowledge up to 4, sending an Ack of 5. The sender would send 5 and wait to hear from the receiver

where it should start up again. The receiver sends Ack 7, so the sender knows it can start

sending again with octet 7.

TCP Header

Page 189: Ccna Lec2 Physical Datalink Internet Transport

191

Sliding Window Protocol Sliding window algorithms are a method of flow control for

network data transfers using the receivers Window size. The sender computes its usable window, which is how much data

it can immediately send. Over time, this sliding window moves to the rights, as the receiver

acknowledges data. The receiver sends acknowledgements as its TCP receive buffer

empties. The terms used to describe the movement of the left and right

edges of this sliding window are:1. The left edge closes (moves to the right) when data is sent and

acknowledged.2. The right edge opens (moves to the right) allowing more data to

be sent. This happens when the receiver acknowledges a certain number of bytes received.

3. The middle edge open (moves to the right) as data is sent, but not yet acknowledged.

*

Octets sent

Not ACKed

Usable Window

Can send ASAP

Working Window sizeUsable Window

Can send ASAP

Initial Window size

Page 190: Ccna Lec2 Physical Datalink Internet Transport

192

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

Host A - Sender Host B - Receiver

Host B gives Host A a window size of 6 (octets). Host A begins by sending octets to Host B: octets 1, 2, and 3 and

slides it’s window over showing it has sent those 3 octets. Host A will not increase its usable window size by 3, until it

receives an ACKnowldegement from Host B that it has received some or all of the octets.

Host B, not waiting for all of the 6 octets to arrive, after receiving the third octet sends an expectational ACKnowledgement of “4” to Host A.

ACK 4Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

*

Octets received

Page 191: Ccna Lec2 Physical Datalink Internet Transport

193

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

ACK 4

Host A does not have to wait for an acknowldegement from Host B to keep sending data, not until the window size reaches the window size of 6, so it sends octets 4 and 5.

Host A receives the acknowledgement of ACK 4 and can now slide its window over to equal 6 octets, 3 octets sent – not ACKed plus 3 octets which can be sent asap.

45

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

ACK 6

Host B - ReceiverHost A - Sender

*

Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

Page 192: Ccna Lec2 Physical Datalink Internet Transport

194

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1

23

ACK 4

More sliding windows

45

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

ACK 6

Host B - ReceiverHost A - Sender

*

Octets sent

Not ACKed

Usable Window

Can send ASAP

Window size = 6

1 2 3 4 5 6 7 8 9 10 11 12 13

76

98

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 13

1 2 3 4 5 6 7 8 9 10 11 12 131 2 3 4 5 6 7 8 9 10 11 12 13

Page 193: Ccna Lec2 Physical Datalink Internet Transport

195

Default 8K for Windows, 32K for Linux, There are various unix/linux/microsoft programs that allow you to

modify the default window size. I do not recommend that you mess around with this unless you know

what you are doing. “Disclaimer: Modifying the registry can cause serious

problems that may require you to reinstall your operating system. We cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.”

NOTE: I take no responsibility for this software or any others!*

Page 194: Ccna Lec2 Physical Datalink Internet Transport

196

TCP provides sequencing of segments with a forward reference acknowledgment.

Each datagram is numbered before transmission. At the receiving station, TCP reassembles the segments into a

complete message. If a sequence number is missing in the series, that segment is

retransmitted. If segments are not acknowledged within a given time period,

retransmission occurs.

0 15 16 31

16-bit Source Port Number

16-bit Destination Port Number

32-bit Sequence Number

32 bit Acknowledgement Number

4-bit Header Length

6-bit (Reserved)

URG

ACK

PSH

RST

SYN

FIN

16-bit Window Size

16-bit TCP Checksum

16-bit Urgent Pointer

Options (if any)

Data (if any)

TCP Header

This is only if one octet was sent at a time.