20
DATA COMMUNICATION AND NETWORKING DAWOOD FAHEEM ABBASI BSCS-IV-05 DATED: JUNE,08 2016 UNIVERSITY OF AZAD JAMMU & KASHMIR MUZAFFARABAD

TCP/IP and UDP protocols

Embed Size (px)

Citation preview

Page 1: TCP/IP and UDP protocols

DATA COMMUNICATION AND NETWORKING

DAWOOD FAHEEM ABBASIBSCS-IV-05DATED: JUNE,08 2016

UNIVERSITY OF AZAD JAMMU & KASHMIRMUZAFFARABAD

Page 2: TCP/IP and UDP protocols

WORKING OF TCP/IP AND UDP PROTOCOLS

TCP/IP & UDP PROTOCOLS

Page 3: TCP/IP and UDP protocols

INTRODUCTIONTCP/IP and the OSI Model Comparison

THE TCP/IP AND OSI MODEL• TCP/IP PROTOCOL SUITE

Host-to-Host Layer ProtocolsTransmission Control Protocol (TCP)

• TCP SEGMENT FORMATUser Datagram Protocol (UDP)

• UDP SEGMENT FORMATWhich One Should You Use?

CONTENT LIST

Page 4: TCP/IP and UDP protocols

• The  TCP/IP suite was created by the U.S. Department of Defense• To ensure that communications could survive any conditions and that

data integrity wouldn't be compromised under malicious attacks.• The Open Systems Interconnection Basic Reference Model (OSI

Model) is an abstract description for network protocol design, developed as an effort to standardize networking.

Introduction

Page 5: TCP/IP and UDP protocols

• Let's Start by Comparing TCP/IP and the OSI Models. • The TCP/IP model is basically a shorter version of the OSI

model. • It consists of four instead of seven layers. • Despite their architectural differences, both models have

interchangeable transport and network layers and their operation is based upon packet-switched technology.

TCP/IP and the OSI Model Comparison

Page 6: TCP/IP and UDP protocols

THE TCP/IP AND OSI MODEL

Page 7: TCP/IP and UDP protocols

Application Layer: • Deals with representation, • Encoding • Dialog control issues. Host-to-Host: • Its equivalent Transport protocol in the OSI model. • Its responsibilities include application data segmentation, • Transmission reliability, flow and error control.Internet: • Their purpose is to route packets to their destination independent of the path

taken.Network Access: • The network access layer deals with all the physical issues concerning • Data termination on network media. • It includes all the concepts of the data link and physical layers of the OSI model

for both LAN and WAN media.

Page 8: TCP/IP and UDP protocols

TCP/IP PROTOCOL SUITE

Page 9: TCP/IP and UDP protocols

Two protocols: 

1. Transmission Control Protocol (TCP) and 2. User Datagram Protocol (UDP)

Host-to-Host Layer Protocols

Page 10: TCP/IP and UDP protocols

• TCP is connection-oriented in the sense that prior to transmission end points need to establish a connection first.

• TCP protocol data units are called segments. • The sending and receiving TCP entities exchange data in the form of segments,

which consist of a fixed 20-byte(160 bits) header followed by a variable size data field.

• TCP is responsible for breaking down a stream of bytes into segments and reconnecting them at the other end,

• Retransmitting whatever might be lost and also organizing the segments in the correct order.

• The segment size is restricted by the maximum transfer unit (MTU) of the underlying link layer technology (MTU is generally 1500 bytes which is the maximum payload size of the Ethernet).

Transmission Control Protocol (TCP)

Page 11: TCP/IP and UDP protocols

TCP SEGMENT FORMAT

Page 12: TCP/IP and UDP protocols

Source Port & Destination Port:

• Fields together identify the two local end points of the particular connection. • A port plus its hosts' IP address forms a unique end point. • Ports are used to communicate with the upper layer and distinguish different application sessions on the host.

Sequence Number & Acknowledgment Number • Fields specify bytes in the byte stream. • The sequence number is used for segment differentiation• Useful for reordering or retransmitting lost segments. • The Acknowledgment number is set to the next segment expected.

Data offset or TCP header length • Indicates how many 4-byte words are contained in the TCP header.

Window field• Indicates how many bytes can be transmitted before an acknowledgment is received.

The Checksum•  Field is used to provide extra reliability and security to the TCP segment.

The actual user data • are included after the end of the header.

Page 13: TCP/IP and UDP protocols

• UDP protocol consists of fewer fields compared to TCP. • The reason for that is because certain data types do not require reliable

delivery and extra overhead. • Real-time traffic for example, needs to be transported in an efficient way

without error correction and retransmission mechanisms.• UDP is considered to be a connectionless protocol. • It leaves reliability to be handled by the application layer. • All it cares about is fast transmission. • The UDP segment format is presented in the next slide.

User Datagram Protocol (UDP)

Page 14: TCP/IP and UDP protocols

UDP SEGMENT FORMAT

Page 15: TCP/IP and UDP protocols

• The IP routing processes for all nodes involved in the delivery of an IP packet include the sending host, the intermediate routers, and the destination host.

END TO END DELIVERY

Page 16: TCP/IP and UDP protocols

• When a host sends a packet, the packet is transmitted from an upper layer protocol (TCP, UDP, or ICMP) to IP, and then IP on the sending host does the following:

• Sets the Time-to-Live (TTL) value to either a default or application-specified value.

• Checks its routing table for the best route to the destination IP address. 

If no route is found, IP sends a routing error message to the upper layer protocol (TCP, UDP, or ICMP).

• Determines the next-hop IP address and the interface, based on the most specific matching route.

• Sends the packet, the next-hop IP address, and the next-hop interface to Address Resolution Protocol (ARP), and then ARP resolves the next-hop IP address to its media access control (MAC) address and forwards the packet.

IP on the Sending Host

Page 17: TCP/IP and UDP protocols

When a packet is received at a router, the packet is passed to IP, and IP on the router does the following:• Verifies the IP header checksum.  If the IP header checksum fails, the IP packet is discarded without notification to the user. This is known as a silent discard.

• Verifies whether the destination IP address in the IP packet corresponds to an IP address assigned to a router interface. If so, the router processes the IP packet as the destination host If the destination IP address is not the router, IP decrements the Time-to-Live (TTL). 

If the TTL is 0, the router discards the packet and sends an ICMP Time Expired–TTL Expired in Transit message to the sender.• If the TTL is 1 or greater, IP updates the TTL field and calculates a new IP header checksum.

• IP checks its routing table for the best route to the destination IP address in the IP packet. If no route is found, the router discards the packet and sends an ICMP Destination Unreachable–Host Unreachable message to the sender.

• Based on the best route found, IP determines the next-hop IP address and interface.

• IP sends the packet, the next-hop IP address, and the interface to ARP, and then ARP forwards the packet to the appropriate MAC address.

• This entire process is repeated at each router in the path between the source and destination host.

IP on the Router

Page 18: TCP/IP and UDP protocols

When a packet is received at the destination host, it is passed up to IP, and IP on the destination host does the following:• Verifies the IP header checksum. 

If the IP header checksum fails, the IP packet is silently discarded.

• Verifies that the destination IP address in the IP packet corresponds to an IP address assigned to the host. If the destination IP address is not assigned to the host, the IP packet is silently discarded.

• Passes the IP packet without the IP header to the appropriate upper-level protocol, based on the IP protocol field. 

If the protocol does not exist, ICMP sends a Destination Unreachable–Protocol Unreachable message back to the sender.

• For TCP and UDP packets, IP checks the destination port and processes the TCP segment or UDP header. If no application exists for the UDP port number, ICMP sends a Destination Unreachable–Port Unreachable message back to the sender. If no application exists for the TCP port number, TCP sends a Connection Reset segment back to the sender.

IP on the Destination Host

Page 19: TCP/IP and UDP protocols

Which One Should You Use?

Page 20: TCP/IP and UDP protocols

TAKE A SMILE, THEY ARE FREE

THANK YOU