Professional Documents
Culture Documents
TRANSPORT LAYER
The main role of the transport layer is to provide the communication services directly to the application
processes running on different hosts.
Example of transport layer protocols are: TCP and UDP.
TRANSPORT SERVICE
1. WRITE ABOUT TRANSPORT LAYER SERVICES. (PART - C)
2. WRITE SHORT NOTES ON SERVICES PROVIDED TO THE UPPER LAYER BY TRANSPORT
LAYER. (PART - B)
3. WRITE SHORT NOTES ON BERKELEY SOCKET. (PART – B)
Services provided to the upper layer
The ultimate goal of the transport layer is to provide efficient, reliable, and cost-effective data transmission
service to its users.
The software and/or hardware within the transport layer that does the work is called the transport entity.
The transport entity can be located in the operating system kernel, in a library package bound into network
applications, in a separate user process, or even on the network interface card.
The first two options are most common on the Internet.
There are also two types of transport service. The connection-oriented transport service is similar to the
connection-oriented network service in many ways.
Transport Service Primitives
Each transport service has its own interface.
The transport service is similar to the network service, but there are also some important differences.
The main difference is that the network service is intended to model the service offered by real networks.
Real networks can lose packets, so the network service is generally unreliable.
A second difference between the network services and transport service is that the services are planned for.
Berkley sockets
These primitives are widely used for internet programming.
1
They are listed in the following fig.
CONNECTION MANAGEMENT
2
ADDRESSING, ESTABLISHING AND RELEASING A CONNECTION
6. WRITE ABOUT CONNECTION ESTATBLISHMENT PROCEDURE IN TRANSPORT LAYER.
(PART – B)
Addressing:
When an application process wishes to set up a connection to a remote application process, it must specify
which one to connect. In the Internet, these end points are called ports.
The generic term TSAP, (Transport Service Access Point) is used to specify the endpoint in the transport
layer.
Application processes, both clients and servers, can attach themselves to a TSAP to establish a connection
to a remote TSAP. These connections run through NSAPs on each host, as shown.
A possible scenario for a transport connection is as follows
1. TSAP 1522 to wait for an incoming call.
2. An application process on host 1 wants to find out the time-of-day.
3. The application process then sends over a request for the time.
4. The time server process responds with the current time.
5. The transport connection is then released
Connection Establishment:
Transport service for connection establishment are:
Listen: Block until some process tries to connect
Connect: Actively attempt to establish a connection
Send: Send information
Receive: Block until a data packet arrives
Disconnect: This release the connection
Two-way Handshaking:
3
Connection establishment is asymmetric
one side puts itself in a LISTEN state (server)
one side issues a request for connection (client)
B
Host B
SeqNo = x
Host A Host B
respond
sACK
to (SeqNo
= y)
CR(SeqN
Result: A starts to
Three-Way Handshake:
oAcknowledg
= z),
send data with
Three Way Handshake is a process used for establishing a connection.
e request,
an old
Step-01: SYN-
Sequence x. B will
For establishing a connection, B will wants
duplicat
throw the data
1. Client sends a request segment
2. Request segment consistsaway
to the server.
only of TCPsince ane
Header withit
to start with
empty payload.
SeqNo = y
expects SeqNo
3. Then, it waits for a reply segment from the server.
=z
connecti
DATA
on
(SeqNo = x)
requests
Data A
from
transmissio
In the
Request segment contains the following information in TCP header-
1. Initial sequence number
n with
shown
2. SYN bit set to 1 SeqNo x
sce-
3. Maximum segment size
4. Receiving window size nario, A
Step-02: SYN + ACK-
believes
After receiving the request segment, that the
4 ACK is
1. Server responds to the client by sending the reply segment.
2. It informs the client of the parameters at the server side.
Retransmission:
When sender discovers that the segment sent by it is lost, it retransmits the same segment to the receiver.
After establishing the connection,
1. Sender starts transmitting TCP segments to the receiver.
2. A TCP segment sent by the sender may get lost on the way before reaching the receiver.
3. This causes the receiver to send the acknowledgement with same ACK number to the sender.
4. As a result, sender retransmits the same segment to the receiver.
5. This is called as retransmission.
Sender discovers that the segment is lost when-
1. Either Time Out Timer expires
2. Or it receives three duplicate acknowledgements
5
Retransmission After Time Out Timer Expiry-
Each time sender transmits a TCP segment to the receiver, it starts a Time Out Timer.
Now, following two cases are possible-
Case-01:
1. Sender receives an acknowledgement for the sent segment before the timer goes off.
2. In this case, sender stops the timer.
Case-02:
1. Sender does not receives any acknowledgement for the sent segment and the timer goes off.
2. In this case, sender assumes that the sent segment is lost.
3. Sender retransmits the same segment to the receiver and resets the timer.
Connection Release:
6
Consider-
1. There is a well established TCP connection between the client and server.
2. Client wants to terminate the connection.
Step-01:
For terminating the connection,
1. Client sends a FIN segment to the server with FIN bit set to 1.
2. Client enters the FIN_WAIT_1 state.
3. Client waits for an acknowledgement from the server.
Step-02:
After receiving the FIN segment,
1. Server frees up its buffers.
2. Server sends an acknowledgement to the client.
3. Server enters the CLOSE_WAIT state.
Step-03:
After receiving the acknowledgement, client enters the FIN_WAIT_2 state.
Step-04:
For terminating the connection,
1. Server sends a FIN segment to the client with FIN bit set to 1.
2. Server waits for an acknowledgement from the client.
Step-05:
After receiving the FIN segment,
1. Client frees up its buffers.
2. Client sends an acknowledgement to the server (not mandatory).
3. Client enters the TIME_WAIT state.
7
A SIMPLE TRANSPORT PROTOCOL
The Example Service Primitives
The Example Transport Entity
The Example as a Finite State Machine
9
The client stub packs the procedure parameters into a message. The packing of the procedure parameters
is called marshalling.
The client's local OS sends the message from the client machine to the remote server machine.
The server OS passes the incoming packets to the server stub.
The server stub unpacks the parameters -- called unmarshalling.
When the server procedure is finished, it returns to the server stub, which marshals the return values
into a message.
The server stub then hands the message to the transport layer.
The transport layer sends the resulting message back to the client transport layer, which hands the
message back to the client stub.
The client stub unmarshalls the return parameters, and execution returns to the caller.
10
X: This 1-bit field, if set to 1, indicates an extra extension header between the basic header and the data.
Introduction to TCP
It provides a reliable transport service between pairs of processes executing end system using the network
layer service provided by the IP protocol.
TCP Service Model
Process-to-Process Communication:
TCP provides process-to-process communication using port numbers. Table lists some well-known port
numbers used by TCP.
Port Protocol Description
7 Echo Echoes a received datagram back to the sender
9 Discard Discards any datagram that is received
11 Users Active users
13 Daytime Returns the date and the time
53 DNS Domain Name Server
80 HTTP Hypertext Transfer Protocol
11
111 RPC Remote Procedure Call
Stream Delivery Service:
TCP allows the sending process to deliver data as a stream of bytes and allows the receiving process to
obtain data as a stream of bytes.
The sending process produces (writes to) the stream of bytes, and the receiving process consumes (reads
from) them.
Full-Duplex Communication:
TCP offers full-duplex service, in which data can flow in both directions at the same time.
Each TCP then has a sending and receiving buffer, and segments move in both directions.
Connection-Oriented Service:
TCP is a connection-oriented protocol.
When a process at site A wants to send and receive data from another process at site B, the following
occurs:
1. The two TCPs establish a connection between them.
2. Data are exchanged in both directions.
3. The connection is terminated.
Reliable Service:
TCP is a reliable transport protocol.
It uses an acknowledgment mechanism to check the safe and sound arrival of data.
TCP Protocol
TCP Segment Header
12
Source port: Defines the port number of the application program in the host that is sending the segment.
Destination port: Defines the port number of the application program in the host that is receiving the
segment.
Sequence number: It tells the destination which byte to be transmitted is numbered.
Acknowledgment number: Defines the byte number
Header Length: The length of the header can be between 20 and 60 bytes.
Reserved: Remains reserved for future use.
Control: This field defines 6 different control bits or flags. One or more of these bits can be set at a time.
Window: Specifies the size of the sender receiver widows. The maximum size of the window is 65,535
bytes.
Checksum: Indicates whether the header was damaged in transmit.
Urgent pointer: Which is valid only if the urgent flag is set and it is used when the segment contains urgent
data.
Options: Specifies various TCP options
Data Transfer
After connection is established, bidirectional data
transfer can take place. The client and server can both
send data and acknowledgments.
13
Connection Release
Any of the two parties involved in exchanging data (client or
server) can close the connection, although it is usually initiated
by the client.
14
TCP Timer Management
Wireless TCP and UDP
Transactional TCP
NETWORK SECURITY
It is a set of rules and configurations designed to protect the integrity, confidentiality and
accessibility of computer networks and data using both software and hardware
technologies.
CRYPTOGRAPHY
10. WRITE SHORT NOTES ON CRYPTOGRAPHY. (PART - B)
11. EXPLAIN THE ALGORITHMS USED IN CRYPTOGRAPHY. (PART - C)
12. DESCRIBE ABOUT SUBSTITUTION CIPHERS. (PART – B)
13. WRITE ABOUT TRANSPOSITION. (PART – B)
Introduction to Crytography
Cryptography is a method of storing and transmitting data in a particular form.
Plain text is converted into a numerical value then it is encrypted with an encryption key,
and then we get the ciphered text.
Substitution Ciphers
15
Substitution technique is a classical encryption technique where the characters present in
the original message are replaced by the other characters or numbers or by symbols
Caesar Cipher:
This the simplest substitution cipher by Julius Caesar.
In this substitution technique, to encrypt the plain text, each alphabet of the plain text is
replaced by the alphabet three places further it.
And to decrypt the cipher text each alphabet of cipher text is replaced by the alphabet three
places before it.
A full translation chart of Caesar cipher are:
Transpositions Ciphers
A transposition is an encryption in which the letters of the message are rearranged.
The columnar transposition is a rearrangement of the characters of the plaintext into
columns.
The plaintext characters are written in rows of five and arranged one row after another,
as shown here:
C1 C2 C3 C4 C5
16
C6 C7 C8 C9 C10
C11 C12 Etc.,
Suppose if the plain text message is, security then it can be arranged in five columns as:
S E C U R
I T Y
One-time Pads
In this technique, a plaintext is paired with a random secret key
Then, each bit or character of the plaintext is encrypted by combining it with the
corresponding bit or character from the pad using modular addition.
17
Calculation:
Encoding:
Decoding:
18
Suppose after 10 sec, message must be thrown out of the network
-------------------UNIT-V COMPLETED-------------------
REFERENCE:
1. Computer Networks‖ Andrew S. Tanenbaum , Fourth edition,PHI private Ltd, NewDelhi , 2008
2. www.slideshare.com
3. www.tutorialspoint.com
POSSIBLE QUESTIONS
PART - A (1 MARK)
1. Transport layer aggregates data from different applications into a single stream before passing it to
____________
a) network layer b) data link layer c) application layer d) physical layer
2. Which of the following are transport layer protocols used in networking?
a) TCP and FTP b) UDP and HTTP c) TCP and UDP d) HTTP and FTP
3. User datagram protocol is called connectionless because _____________
a) all UDP packets are treated independently by transport layer
b) it sends data as a stream of related packets
c) it is received in the same order as sent order
d) it sends data very quickly
4. Transmission control protocol ___________
a) is a connection-oriented protocol b) uses a three way handshake to establish a connection
c) receives data from application as a single stream d) all of the mentioned
5. An endpoint of an inter-process communication flow across a computer network is called __________
a) socket b) pipe c) port d) machine
6. Which one of the following is a version of UDP with congestion control?
a) datagram congestion control protocol b) stream control transmission protocol
c) structured stream transport d) user congestion control protocol
7. A _____ is a TCP name for a transport service access point.
a) port b) pipe c) node d) protocol
8. Transport layer protocols deals with ____________
a) application to application communication b) process to process communication
c) node to node communication d) man to man communication
9. Which of the following is a transport layer protocol?
a) stream control transmission protocol b) internet control message protocol
19
c) neighbor discovery protocol d) dynamic host configuration protocol
10. Which of the following is a transport layer protocol?
a) DNS b) HTTP c)TCP d)ARP
PART – B (5 MARKS)
1. Write short notes on services provided to the upper layer by transport layer. (Refer Page
3. Differentiate between data link layer and transport layer. (Refer Page No.2,Q. No.5)
4. Write about connection establishment procedure in transport layer. (Refer Page No.3,Q.
No.6)
5. Write about flow control and error control. (Refer Page No.8 ,Q. No.7)
6. Write about UDP packet format. (Refer Page No.15 ,Q. No.9)
9. Write about stream delivery service in TCP. (Refer Page No.18 ,Q. No.13)
10. Explain the TCP header format with an diagram. (Refer Page No.18 ,Q. No.14)
11. What is additive increase and multiplicative decrease? Explain with an example. (Refer
3. Explain about congestion control with an neat diagram. (Refer Page No.12,Q. No.8)
20