|Notice: Exam Form BE IV/II & BAR V/II (Back) for 2076 Magh|
|Routine: BE IV/II & BAR V/II - 2076 Magh|
|Result: BCE I/II exam held on 2076 Bhadra|
|Result: All (except BCE & BEI) I/II exam held on 2076 Bhadra|
|Notice: Exam Center for Barrier Exam (2076 Poush), 1st Part|
|Electronics and Communication(BEX)|
- Transport layer is layer 4 of OSI model which is responsible for peer-to-peer connection between two processes on remote hosts.
Functions of Transport Layer
- The functions of transport layer are:
a) It breaks the data obtained from application layer into smaller segments.
b) It ensures that data must be received in same sequence in which it was sent.
c) It provides end-to-end delivery of data between hosts.
Services provided by Transport Layer
- The services provided to upper layers are:
a) Addressing (handles addressing of the processes on the node.)
b) Connection management (establish and release connections.)
c) Flow control and buffering
- UDP uses minimum amount of communication mechanism.
- The receiver does not generate an ack of packet received.
Requirements of UDP
- UDP is deployed where ack packets share significant amount of bandwidth along with actual data.
- Even if some packets are lost, it can be ignored easily.
- Eg: in video streaming
Features of UDP
- It is used if ack of data does not have significance.
- It flows data in one direction.
- It is suitable for query based communication.
- It is connectionless.
- It does not provide congestion control mechanism.
- It does not guarantee data delivery in order.
- It is stateless.
- Source port identifies the port of application process of sender.
- Destination port identifies the port of application process of receiver.
- Length specify the entire length of UDP packet with header.
- Checksum stores checksum value generated by the sender before sending.
Features of TCP
- TCP is reliable protocol as the receiver always send positive or negative ack about data packet to the sender such that it knows whether data packet reach destination or it needs to resend it.
- It ensures that data reaches intended destination in proper order.
- It requires connection between two remote ends to be established before sending actual data.
- It provides error checking and recovery mechanisms.
- It provides flow control and quality of service.
- It operates in client-server point-to-point mode.
- It provides full duplex server (it can perform roles of both receiver and sender).
- The length of TCP header is minimum of 20 bytes and maximum of 60bytes.
- Source port identifies port of application process of sender.
- Destination port identifies port of application process of receiver.
- Sequence number of data bytes of segment.
- Acknowledge no contains next sequence number of data byte expected when ACK flag is set.
- Data offset implies size of TCP header and offset of data in current packet.
- Reserved is for future use and all are set zero by default.
a) None Sum (NS) = Explicit congestion notification signaling process.
b) Congestion Window Reduced (CWR) = It is set when a host receives packet with ECE bit set to acknowledge that ECE is received.
c) ECE = If SYN bit is 0, IP packet has CE bit set. If SYN bit is 1, the device is ECT capable.
d) URG = Urgent pointer field has significant data and should be processed if URG is set.
e) ACK = Acknowledgement field has significance if set.
f) PSH = When set, it is a request to receiving node to push data to application without buffering.
g) RST = It is used to refuse incoming connection, reject a segment and restart a connection.
h) SYN = It is used to setup connection between hosts.
i) FIN = It is used to release connection.
- Window size is used to control flow and indicates amount of buffer in bytes the receiver has allocated for a segment.
- Checksum contains checksum of header (data and pseudo header).
- Urgent pointer points to urgent data byte if URG flag is set.
- Options provide additional options.
Addressing in TCP
- TCP communication between two remote hosts is done by means of port numbers known as Transport Service Access Points.
- Port numbers ranges from 0 to 65535.
0 – 1023 = System port
1024 – 49151 = User port
49152 – 65535 = Private port
TCP Connection Management
- 3 way handshake is used for TCP connection management.
- Client initiates the connection and sends the segment with a sequence number.
- Server acknowledges it back with its own sequence number and ACK of client’s segment.
- Client after receiving ACK of its segment sends an ACK of server’s response.
- Either server or client send TCP segment with FIN flag set to 1.
- The receiving end responds it by acknowledging FIN.
- The TCP communication is closed and connection is released.
Q) For client server application over TCP, server program must be executed before the client program. Why?
- For TCP applications, as soon as the client is executed, it attempts to initiate a TCP connection with the server. If the TCP server is not running, then the connection can not be established.
Port and Socket
- Port is an endpoint of communication.
- A port is associated with IP address of host and protocol used.
- A port is identified by a 16-bit number known as port number.
IP of host = 18.104.22.168
Port no = 80
Protocol used = TCP
- Socket is one endpoint in a communication flow between two programs running over network.
- It is created and used with a set of programming requests.
- It is also used for communication between processes within the same computer.
Q) Why port number is used?
- Port number provides a way to identify a specific process to which the message is to be forwarded when it arrives at a server.
Congestion Control Algorithm - Token Bucket and Leaky Bucket
- Congestion is the reduction of quality of service that occurs when a network node is carrying more data than it can handle.
Token Bucket Algorithm:
- It is an algorithm used in packet switched networks. For congestion control mechanism.
- A bucket is of fixed capacity.
- A token is added to the bucket every 1/r seconds.
- The bucket can hold at most b tokens.
- If a token arrives when the bucket is full, it is discarded.
- When the packet of n bytes arrives, n tokens are removed from the bucket, and the pocket is sent to the network.
- If fewer than n tokens are available, no tokens are removed from the bucket and the packet is considered to be non-conformant.
Leaky Bucket Algorithm:
- It is used to determine whether same sequence of events conforms to defined limits.
- A fixed capacity bucket associated with each user, leaks at a fixed rate.
- If bucket is empty, it stops leaking.
- For a packet to conform, it has to be possible to add a specific amount of water to the bucket.
- If the amount of water could cause the bucket to exceed its capacity, the packet does not conform and the water in the bucket is left unchanged.
-By SURAJ AWAL