52
06/23/22 1 TCP/IP Transmission Control Protocol Internet Protocol

10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Embed Size (px)

Citation preview

Page 1: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

04/19/23 1

TCP/IPTransmission Control Protocol

Internet Protocol

Page 2: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

TCP/IP• Set of protocols that defines how all

transmissions are exchanged across the Internet

• An Internet under TCP/IP operates like a single network connecting many computers of any size and type.

• An Internet is an interconnection of independent physical networks (such as LANs) linked together by internetworking devices.

Page 3: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

An Internet According to TCP/IP

A, B, C - hosts 1, 2, 3 – routers, gatewaysI, II, III – separate physical networks

Page 4: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

TCP/IP and the OSI Model

Page 5: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP ( Internet Protocol )

Network Layer

Page 6: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Internet Protocol• IP’s current version is Version 4 (IPv4). It is specified

in RFC 891.

• IP is used to provide interconnection among subnetworks.

• It defines a protocol not a connection.

• It provides connectionless delivery making it unreliable.

• It has no flow control. It has no checksum for the data contents of the datagram.

Page 7: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

4 Main Functions of IP

1. Basic data transfer

2. Addressing

3. Routing

4. Fragmentation of datagrams

Page 8: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

• 20 bytes ≤ Header Size < 24 x 4 bytes = 60 bytes• 20 bytes ≤ Total Length < 216 bytes = 65536 bytes

Page 9: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

1. Version number (4 bit field)- contains the IP version number of the protocol software is using - receiving station must first check the version number of incoming

datagrams before proceeding to analyze the rest of the header and encapsulated data.

2. Internet Header Length (4 bit field)- the length of the Internet header in 32 bit words, and thus points to

the beginning of the data.

***Note that the minimum value for a correct header is 5 words (20 bytes) and the maximum is 15 words (60 bytes).

Page 10: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

3. Type of Service

-  provides an indication of the abstract parameters of the quality of service desired.

- specifies the manner in which a packet is routed.

 

Several networks offer service precedence, which somehow treats high precedence traffic as more important than other traffic.

The major choice is a three-way tradeoff between low-delay, high-reliability, and high-throughput.

Page 11: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

3.1 Precedence- indicates the datagram’s importance- eight levels are used (0-7), the higher the number, the more important the datagram

 3.2 Delay if = 0, High Delay if = 1, Low Delay

3.3 Throughput If = 0, Low Throughput if = 1, High Throughput

3.4 Reliability if = 0, Low Reliability if = 1, High Reliability

 * Bits 14-15 are reserved for future use and is usually set to 00

Precedence Delay Throughput Reliability Not used

8 - 10 11 12 13 14 - 15

Page 12: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

4. Total Length

- length of the datagram, measured in octets, including Internet header and data. This field allows the length of a datagram to be up to 65,535 octets.

 

5. Identification

- a value assigned by the IP sender of an IP as an aid to reassembling fragmented packets (16 bits).

 

Each of the fragmented datagrams will have the same Identification field value, which enables IP to reassemble fragmented datagrams correctly.

 

Page 13: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

6. Flags-  used to control fragmentation 

Bit 16 - Reserved and usually set to 0 

Bit 17 – Don’t Fragment (DF) Flag- indicates whether or not a datagram can be fragmented- if DF = 1, datagram cannot be fragmented

Bit 18 – More Fragments (MF) Flag- if MF = 1, more datagram must be reassembled to recreate

the full datagram

- last fragment has its MF = 0 so that the receiving device knows when to stop waiting for datagrams

 

R D M F F

16 17 18

Page 14: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

7. Fragmentation Offset- contains the position number of the fragments so that

they can be reassembled in proper order

8. Time to Live (TTL)2 Functions of the TTL field1.      to limit the lifetime of transmitted data2.       to end routing loops

If the TTL field has expired (TTL = 0), current node must discard the datagram but a message is sent back to the sending station requesting it to send again the discarded datagram.

Page 15: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

9. Protocol– identifies which higher layer protocol should

receive the data portion of the datagram

Value Name Protocol

1 ICMP Internet Control Message Protocol

6 TCP Transmission Control Protocol

17 UDP User Datagram Protocol

46 RSVP Reservation Protocol

80 ISO-IP ISO Internet Protocol

Page 16: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Datagram / IP Header

10.  Header Checksum

- checks the IP header for errors

11.  Source IP Address

- contains the 32 bit IP address of the sending station

12.  Destination IP Address

- contains the 32 bit IP address of the destination station

13.  Options

- contains information on source routing, tracing a route, time stamping the packet as it traverses routers, security entries.

-   found only on IPv4

Page 17: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Source Routing- the ability of the originating station to place route

information in a datagram to be interpreted by routers.

2 types of source routing

1.  Strict

Routing path must not deviate from the route information specified by

the source.

2.  Loose

Allows a router to forward packets to any router it feels is correct to service the next route indicated in the Source route field.

Page 18: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

FRAGMENTATION

• Datagram fragmentation is necessary to ensure that data transmitted from one network may not be too large when received by another network.

Page 19: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

NETWORK ADDRESSING

1. Classless - the full address range can be used without regard to bit reservation

- used by routers of ISPs

2. Classful - 32 bit address is segmented to denote network and host id

Page 20: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Internet Address

Page 21: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Internet Classes

Page 22: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

IP Addresses in Decimal Notation

Page 23: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Class Ranges of Internet Addresses

Page 24: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Network and Host Addresses

Sample Internet

Page 25: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

A Network with Two Levels of Hierarchy

Page 26: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

SUBNETTING – Refers to the partitioning of a network address

space into separate autonomous subnetworks.

– Subnetting allowed tremendous efficiency not only in Internet routing tables but also on customer networks.

– It allows reassignment of some of the bits normally used by the host portion of the address to the network portion of the address.

Page 27: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

A Network with Three Levels of Hierarchy

Internet is not aware that the network is divided into 3 physical subnetworks

R1 knows that the network 141.14 is divided into 3 subnetworks

Address Netid (2 octets) Subnetid (1 octet) Hostid (1 octet)

Page 28: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Three Levels of Hierarchy

Netid – first level, defines the site.

Subnetid – second level, defines the physical subnetwork.

Hostid – third level, defines the connection of the host to the subnetwork.

• Routing of the IP datagram,– Delivery to the site– Delivery to the subnetwork– Delivery to the host

Page 29: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Subnet bit ranges

Class A

0 7 bits of network address Up to 22 bits available for subnetting

10 14 bits of network address Up to 14 bits available for subnetting

Class B

110 21 bits of network address 6 bits for subnetting

Class C

Page 30: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Masking

• Masking is a process that extracts the address of the physical network from an IP address.

– If the network is not subnetted, masking extracts the network address from the IP address.

– In subnetted network, masking extracts the subnetwork address.

Page 31: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Subnet Mask

• A mask is the portion of an address that is subtracted from the original address.

• It indicates how many bits are masked out of the original address to use as a subnet address.

Page 32: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Masking

Page 33: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Addresses with and without Subnetting

Page 34: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Subnet Mask (default)

IP Address Class Default Subnet Mask

Class A 255.0.0.0

Class B 255.255.0.0

Class C 255.255.255.0

Page 35: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Finding the Subnetwork AddressBoundary-Level Masking

(mask numbers-255 or 0)1. The bytes in the IP address that corresponds to 255 in the

mask will be repeated in the subnetwork address.2. The bytes in the IP address that corresponds to 0 in the

mask will change to 0 in the subnetwork address.Example:

Nonboundary-Level Masking (mask numbers- not just 255 or 0)- use bit-wise AND operator to get the subnetwork

address if the mask number is not 255 or 0.Example:

Page 36: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Other Protocols in the Network Layer

• Address Resolution Protocol (ARP)– associates an IP address with the physical

address.– used to find the physical address of the

node when its Internet address is known– when a router needs to find the physical

address of another host on its network, it formats an ARP query packet that includes the IP address and broadcasts it over the network

Page 37: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

ARP

Page 38: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Other Protocols in the Network Layer

• Reverse Address Resolution Protocol (RARP)– allows a host to discover its internet

address when it knows only its physical address.

– used to find the physical address of the node when its Internet address is known

– RARP query packet , send by the host– Server recognizes the RARP packet and

returns the host’s internet address

Page 39: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Other Protocols in the Network Layer

• Internet Control Message Protocol (ICMP)– a mechanism used by hosts and routers to

send notification of datagram problems back to the sender.

• Disabled links, device is on fire, network congestion

– its sole function is to report problems, not to correct them.

Page 40: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Other Protocols in the Network Layer

• Internet Group Message Protocol (IGMP)– designed to help a multicast router identify

the hosts in a LAN that are members of a multicast group

2 types of communication in IP protocol

Unicasting – one-to-one communication

Multicasting – one-to-many communication

Page 41: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

UDP / TCPUser Datagram Protocol

Transmission Control Protocol

TRANSPORT LAYER

Page 42: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

TRANSPORT LAYER

2 Protocols in Transport Layer of TCP/IP

– User Datagram Protocol (UDP)• Provides nonsequenced transport functionality

when reliability and security are less important than size and speed.

– Transmission Control Protocol (TCP)• Provides reliable end-to-end delivery

Page 43: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

• IP – host-to-host protocol (from one physical device to another)

• Delivers a datagram from a source host to a destination host.

• TCP – port-to-port protocol– Define a set of conceptual connections to

individual processes called protocol ports or ports.

• protocol ports – a destination port for storing data (usually a buffer) for use by a particular process.

Page 44: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Port Addresses

Port to port protocols use IP services

Page 45: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

UDP Datagram

• Adds only port addresses, checksum error control and length information to the data from the upper layer

• The packet produced by the UDP is called a user datagram

Page 46: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

TCP/IP and the OSI Model

Page 47: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Figure 24-15

UDP Datagram Format

1. Source port address of the application program that has created the message.

2. Destination port address of the application program that receive the message.

3. Total length of the user datagram in bytes4. Checksum is used for error detection

Page 48: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

Transmission Control Protocol (TCP)

• TCP is a reliable stream transport port-to-port protocol.

• TCP generates a virtual circuit between sender and receiver that is active for the duration of a transmission

• There’s a connection establishment before the transmission and connection termination after the transmission.

• Divides long transmission into smaller data units and packages each into a frame called segments.

Page 49: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

TCP Segment Format

Page 50: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

• Source port address defines the application program in the source computer.

• Destination port address defines the application program in the destination computer.

• Sequence number field shows the position of. the data in the original data stream

• Acknowledgment number is used to acknowledge the receipt of the data from other communicating device.

• Header length – a four bit field indicates the number of words in the TCP header.

Page 51: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

• Reserved – for future use• Control

– Urgent bit – validates the urgent pointer field– ACK bit – validates the acknowledgment number field– PSH bit – used to inform the sender that a higher

throughput is needed– Reset bit – used to reset the connection when there is

confusion in the sequence numbers.– SYN bit – used for sequence number synchronization– FIN bit – used in connection termination

Types of segments• Connection request/ Termination request• Connection confirmation/ Termination confirmation• Confirmation acknowledgment/ Termination confirmation

acknowledgment

Page 52: 10/13/20151 TCP/IP Transmission Control Protocol Internet Protocol

• Window size (16 bit) – defines the size of the sliding window

• Checksum – used in error detection

• Urgent pointer – valid only if the URG bit is set

• Options and padding – optional field– Additional information to the receiver or

alignment purposes