0% found this document useful (0 votes)
2 views

Unit- 4

cn

Uploaded by

Deepthi Nj
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Unit- 4

cn

Uploaded by

Deepthi Nj
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 50

UNIT-4

Transport Layer
OSI Model ( Layers)
1. Application layer
2. Presentation layer
3. Session layer
4. Transport layer
5. Network layer
6. Datalink layer
7. Physical layer

2
Error-----???
How to Control Error???
Error control Mechanism

3
Error control Mechanism
Stop and Wait ARQ (Automatic Repeat reQuest)
Sliding Window

Sliding Window contains


Go Back N
Selective Repeat Protocols

4
STOP AND WAIT ARQ

1. Sender send the data to receiver


2. After sending, the sender has to stops and waits until he
receives the acknowledgment.
3. The stop and wait protocol is a flow control protocol.
4. It is a data-link layer protocol which is used for transmitting the
data over the noiseless channels.
5. It provides unidirectional data transmission which means that
either sending or receiving of data will take place at a time.

5
STOP-AND-WAIT PROTOCOL

• Sliding window of size 1.


• Sequence numbers
• Acknowledgement Numbers

6
SLIDING WINDOW PROTOCOL

1. The sliding window is a technique for sending multiple frames at


a time.
2. It controls the data packets between the two devices where
reliable and gradual delivery of data frames is needed.
3. It is also used in TCP (Transmission Control Protocol).
4. In this technique, each frame has sent from the sequence
number.
5. The purpose of the sliding window technique is to avoid
duplicate data, so it uses the sequence number.

7
GO BACK N PROTOCOL

1. sender can send multiple data packets without waiting for an


acknowledgement for each one.
2. it can only send a certain number of packets (this is called the
“window size”).
3. If one packet is lost or not acknowledged, the sender must go
back and resend that packet and all the packets that followed it,
even if they were received correctly.
4. if packets 1, 2, 3, 4, and 5 are sent and packet 3 gets lost, the
sender will have to resend packets 3, 4, and 5, even if 4 and 5
were received.

8
GO-BACK-N(GBN) PROTOCOL
• The key to Go-back-N is that we can send several packets before
receiving acknowledgments, but the receiver can only buffer one
packet.
SEND WINDOW
• The send window is an imaginary box covering the sequence
numbers of the data packets that can be in transit or can be sent

9
GO-BACK-N(GBN) PROTOCOL
• RECEIVE WINDOW
• The receive window makes sure that the correct data packets are
received and that the correct acknowledgments are sent.
• In Go-Back-N, the size of the receive window is always 1.

10
GO-BACK-N(GBN) PROTOCOL

11
GO-BACK-N(GBN) PROTOCOL

12
13
SELECTIVE REPEAT

• Drawback of GO-BACK-N: Each time a single packet is


lost or corrupted, the sender resends all outstanding
packets, even though some of these packets may have
been received safe and sound but out of order.
• Resends only selective packets, those are actually lost.
• Window size: Less than 2m-1
• The receive window is the same size as the send
window.

14
SELECTIVE REPEAT

• Window size: Less than 2m-1

15
PORT NUMBERS & SERVICES

• Port numbers provide end-to-end addresses at the transport layer


and allow multiplexing and demultiplexing at this layer, just as IP
addresses do at the network layer.

16
USER DATAGRAM PROTOCOL

• The User Datagram Protocol (UDP) is a connectionless,


unreliable transport protocol.
• It does not add anything to the services of IP except for
providing process-to-process communication instead of host-to-
host communication

17
APPLICATION OF UDP

1. Connectionless Service
• Short message
• Less Delay

2. Lack of Error Control


3. Lack of Congestion Control
4. UDP is a suitable transport protocol for multicasting.
5. UDP is used for some route updating protocols such as Routing
Information Protocol (RIP)
6. UDP is normally used for interactive real-time applications that
cannot tolerate uneven delay between sections of a received message

18
Connectionless protocols
•HTTP (hypertext transfer)
•IP
•UDP (User Datagram Protocol)
•ICMP
•IPX
•TIPC
19
Here are some characteristics of connectionless
protocols:

•No guaranteed delivery: There's no guarantee that


the data will be delivered, or that the sender will be
notified if it fails.
•No guaranteed order: The order in which the data is
delivered is not guaranteed.
•Data packets can travel different paths: Each data
packet can travel over different paths to reach its
destination.
•Data packets can be lost: Some data packets may
be lost in transmission.
•Data packets can arrive out of order: Some data 20
packets may arrive out of order relative to other data
TCP SEGMENT

21
22
A TCP CONNECTION
• Full duplex
• Three-way handshaking:
1. Connection establishment
2. Data Transfer
3. Connection Termination

23
A TCP CONNECTION

• Data Transfer

24
A TCP CONNECTION

• Connection Termination:
1. Three-way Handshaking
2. Half Close

Three-way Handshaking
25
A TCP CONNECTION: HALF CLOSE

• Connection Termination:
Half Close

26
TCP FLOW CONTROL
• The receiving TCP controls the sending TCP; the sending
TCP controls the sending process.

27
TCP ERROR CONTROL
• TCP provides reliability using error control.
• Error control includes mechanisms for detecting and resending
corrupted segments, resending lost segments, storing out-of
order segments until missing segments arrive, and detecting and
discarding duplicated segments.
• Error control in TCP is achieved through the use of three simple
tools:
1. Checksum
2. Acknowledgment: Cumulative ACK, Selective ACK
3. Time-out

28
TCP CONGESTION CONTROL
Congestion occurs, if load offered to any network is more than its
capability.

Congestion policy in TCP –


1. Slow Start Phase starts slowly increment is exponential to
threshold
2. Congestion Avoidance Phase: After reaching the threshold
increment is by 1
3. Congestion Detection Phase: Decrease the window size

29
STREAM CONTROL TRANSMISSION PROTOCOL (SCTP)

1. Stream Control Transmission Protocol (SCTP) is a reliable,


message-oriented transport layer protocol.
2. SCTP has mixed features of TCP and UDP.
3. SCTP maintains the message boundaries and detects the lost
data, duplicate data as well as out-of-order data.
4. SCTP provides the Congestion control as well as Flow control.
5. SCTP is especially designed for internet applications.

30
SCTP SERVICES
Some important services provided by SCTP are as stated
below:

1. Process-to- Process communication


SCTP uses all important ports of TCP.

2. Multi- Stream Facility


SCTP provides multi-stream service to each connection, called as
association. If one stream gets blocked, then the other stream can
deliver the data.

3.Full- Duplex Communication


SCTP provides full-duplex service ( the data can flow in both
directions at the same time).
31
SCTP SERVICES

4. Connection- Oriented Service


The SCTP is a connection-oriented protocol, just like TCP with the
only difference that, it is called association in SCTP.
If User1 wants to send and receive message from user2, the steps
are :

Step1: The two SCTPs establish the connection with each other.
Step2: Once the connection is established, the data gets exchanged
in both the directions.
Step3: Finally, the association is terminated.

32
FEATURES OF SCTP
1. Transmission Sequence Number (TSN): The unit of data in SCTP is
a data chunk. Data transfer in SCTP is controlled by numbering the data
chunks. In SCTP, TSN is used to assign the numbers to different data
chunks.

2. Stream Identifier (SI): 16 bit number and starts with 0. In SI, there
are several streams in each association and it is needed to identify them.
Each data chunk needs to carry the SI in the header, so that it is properly
placed in its stream on arrival.

3. Packets: The data is carried out in the form of data chunks and
control information is carried as control chunks. Data chunks and control
chunks are packed together in the packet.

4. Multihoming: Multihoming allows both ends (sender and receiver) to


define multiple IP addresses for communication. But, only one of these
can be defined as primary address and the remaining can be used as
alternative addresses. 33
CLIENT-SERVER PROGRAMMING
USING TCP AND UDP

1. we have seen a TCP server and a UDP server.


2. But now we can combine our concurrent TCP echo server and
iterative UDP server into a single server that uses select to
multiplex TCP and UDP socket.
3. The Select function is used to select between TCP and UDP
sockets.
4. This function gives instructions to the kernel to wait for any of the
multiple events to occur.

34
Server:

1. Create TCP i.e Listening socket


2. Create a UDP socket
3. Bind both sockets to the server address.
4. Initialize a descriptor set for select and calculate a maximum of 2
descriptors for which we will wait
5. Call select and get the ready descriptor(TCP or UDP)
6. Handle new connection if the ready descriptor is of TCP OR
receive datagram if the ready descriptor is of UDP 35
TCP Client:

1. Create a TCP socket.


2. Call connect to establish a connection with the server.
3. When the connection is accepted write a message to a server.
4. Read the response of the Server.
5. Close socket descriptor and exit.

36
UDP Client:

1. Create a UDP socket.


2. Send a message to the server.
3. Wait until a response from the server is received.
4. Close socket descriptor and exit.

37
38
SMTP

• SMTP stands for Simple Mail Transfer Protocol, which is an internet


standard for sending and receiving emails.
• SMTP is a communication protocol that allows mail servers and
other message transfer agents (MTAs) to send, receive, and relay
emails.
• SMTP standardizes the way emails travel from sender to recipient,
similar to how the postal service uses a standardized form of
addressing to operate.
• SMTP usually uses port 25,but can also use ports 465 or 587 if port
25 is blocked. If these ports are also blocked, SMTP can use port
2525.
39
40
DOMAIN NAME SYSTEM (DNS)
• Maps name to address

41
DOMAIN NAME SYSTEM (DNS)
• Name Space
1. A name space that maps each address to a unique name can be organized in two ways:
 Flat
 Hierarchical
1. Flat name space: A name is assigned to an address A name in this space is a sequence of
characters without structure. The names may or may not have a common section.
2. Hierarchical name space: Each name is made of several parts. The first part can define the nature
of the organization, the second part can define the name of an organization, the third part can
define departments in the organization, and so on

42
1. DNS, or the Domain Name System, translates human readable
domain names (for example, www.amazon.com) to machine
readable IP addresses (for example, 192.0. 2.44).
Types of Domain
2. There are various kinds of domains:
• Generic
Domains: .com(commercial), .edu(educational), .mil(military), .org(
nonprofit organization), .net(similar to commercial) all these are
generic domains.
• Country Domain: .in (India) .us .uk
• Inverse Domain: if we want to know what is the domain name of
the website. IP to domain name mapping. So DNS can provide both
the mapping for example to find the IP addresses of
geeksforgeeks.org then we have to type
43
• nslookup www.geeksforgeeks.org
44
DOMAIN NAME SYSTEM (DNS)
• Domain name
 If a label is terminated by a null string, it is called a fully qualified
domain name (FQDN).
 If a label is not terminated by a null string, it is called a partially qualified
domain name (PQDN).
• Domain: Subtree of the domain name space

45
APPLICATION LAYER
INTRODUCTION TO REMOTE LOGIN PROTOCOLS: TELNET
• TELNET (Terminal Network)
• TELNET requires a logging name and password, it is vulnerable to hacking.
• TELNET client, which transforms the characters into a universal
character set called Network Virtual Terminal (NVT)
characters

47
INTRODUCTION TO REMOTE LOGIN PROTOCOLS: SSH
• SSH (Secure Shell)
• 3 Components:
• SSH Transport Layer Protocol (SSH-TRANS)
Privacy or confidentiality
Data Integrity
Server authentication
Compression of Messages

• SSH Authentication Protocol (SSH-AUTH)


 Authenticate client for server

• SSH Connection Protocol (SSH-CONN)


Multiplexing
48
INTRODUCTION TO REMOTE LOGIN PROTOCOLS: SSH
• SSH Packet Format

49
THANK YOU

50

You might also like