Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

DOC-20241209-WA0002.

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Chp 4 (18M)

1. List UDP services and UDP application (any 4 each)


Ans. Services offered by the UDP are a s follows:

• Process to process port to port transmission of segment.


• Connectionless and minimum overhead Protocol
• Fast and simple transmission
• UDP encapsulates and decapsulates the message.

UDP application :
• Domain Name Services.
• Simple Network Management Protocol.
• Trivial File Transfer Protocol.
• Routing Information Protocol.
• Kerberos.
3.The dump of a UDP header in hexadecimal format is as :BC 82000 D 002 B001 D

Obtain the following from it:

1) Source port number


2) Destination port number
3) Total length
4) Length of the data

Ans. The UDP header has four parts, each of two bytes.

That means we get the following interpretation of the header.

i. Source port number = BC82¹⁶ = 48258


ii. Destination port number = 000D¹⁶= 13
iii. Total length = 002B¹⁶ = 43 byte
iv. Since the header is 8 bytes the data length is 43 – 8 =35 bytes.
4. List and explain ,services provided by TCP

Ans. Transmission Control Protocol (TCP) to the processes at the application layer:

• Stream Delivery Service.


• Full Duplex Service
• Connection Oriented Service.
• Reliable Service.

Stream Delivery Service

• TCP is a stream-oriented protocol. It enables the sending process to deliver dataas a


stream of bytes and the receiving process to acquire data as a stream of bytes.
• TCP creates a working environment so that the sending and receiving procedures are
connected by an imaginary "tube"

Full-Duplex Service

• TCP offers a full-duplex service where the data can flow in both directions
simultaneously. Each TCP will then have a sending buffer and receiving buffer. The TCP
segments are sent in both directions.

Connection-Oriented Service

We are already aware that the TCP is a connection-oriented protocol. When a process
wants to communicate (send and receive) with another process (process -2), the sequence
of operations is as follows:

• TCP of process-1 informs TCP of process-2 and gets its approval.

• TCP of process-1 tells TCP of process-2 exchange data in both directions.

Reliable Service

• TCP is a reliable transport protocol. It uses an acknowledgment mechanism for


checking the safe and sound arrival of data.
5. List different timers used in TCP
Ans.

1) Retransmission Timer: To retransmit lost segments, TCP uses


Retransmission Time Out (RTO). When TCP sends a segment the timer starts
and stops when the acknowledgment is received. If the timer expires timeout
occurs and the segment is retransmitted. RTO (retransmission timeout is for 1
RTT) to calculate retransmission timeout we first need to calculate the RTT.

Three Types of RTT:

• Measured RTT (RTTm)


• Smoothed RTT (RTTS)
• Deviated RTT (RTTd)

2) Persistent Timer: To deal with a zero-window-size deadlock situation, TCP


uses a persistence timer. When the sending TCP receives an acknowledgment
with a window size of zero, it starts a persistence timer.
3) Keepalive Timer: A keepalive timer is used to prevent a long idle
connection between two TCPs. If a client opens a TCP connection to a server
transfers some data and becomes silent the client will crash.In this case, the
connection remains open forever. So a keepalive timer is used.
4) Time Wait Timer: This timer is used during TCP connection termination.
The timer starts after sending the last Ack for 2nd FIN and closing the
connection. After a TCP connection is closed, it is possible for datagrams that
are Still making their way through the network to attempt to access the Closed
port
6. Draw & Explain TCP segment structure
Ans. A Packet in TCP is called a segment. TCP segment consists of data bytes to be sent
and a header that is added to the data by TCP as shown in following figure:

The header of TCP


segment can range from
20-60 bytes.40 bytes are
for option. if there are no
options, header is of 20
bytes else it can be of
upmost 60 bytes.

Header Fields in TCP Segment Structure:

1) Source port address: -This is a 16-bit field that defines the port number of the
application program in the host that is sending the segment. This serves the same
purpose as the source port address in the UDP header.
2) Destination port address: - This is a 16-bit field that defines the port number of the
application program in the host that is receiving the segment. This serves the same
purpose as the destination port address in the UDP header.
3) Header length: -This 4-bit field indicates the number of 4-byte words in the TCP header.
The length of the header can be between 20 and 60 bytes. Therefore, the value of this
field can be between 5 (5 x 4 = 20) and 15 (15 x 4 = 60).
4) Reserved:- This is a 6-bit field reserved for future use.
5) Control Field:-This field defines 6 different control bits or flags. These are 6, 1 bit
control bits that controls connection establishment, connection termination,
connection abortion, flow control, mode of transfer etc
The function of control fields in TCP are:
• URG: Urgent pointer is valid.
• PSH: Request for push.
• RST: Reset the connection.
• SYN: Synchronize sequence numbers.
• FIN: Terminate the connection.
6) Window Size: This field tells the window size of the sending TCP
in bytes.
7) Checksum: This field holds the checksum for error control. It is mandatory in TCP as
opposed to UDP.
7. Describe Flow control under SCTP

Ans. SCTP handle two units of data: the byte and the chunk. The values of rwnd and cwnd
are expressed in bytes; the values of TSN and acknowledgments are expressed in chunks.

Receiver Site: The receiver has one buffer (queue) and three variables. The queue holds
the received data chunks that not read by the process. Three variables:

1. cumTSN holds the last TSN received.


2. winSize holds the available buffer size.
3. lastACK holds the last cumulative acknowledgment, lastACK. Figure shows the queue
and variables at the receiver site.

Sender Site: The sender has one buffer (queue) and three variables. We assume each
chunk is 100 bytes long. The buffer holds the chunks that either sent or ready to be sent.
Three variables:

1. curTSN refers to the next chunk to be sent.


2. rwnd holds the last value advertised by the receiver (in bytes).
3. inTransit holds the number of bytes in transit, bytes sent but not yet acknowledged.
1. *Explain how TCP connections are established using the 3 way handshake.
What happens when 2 hosts simultaneously try to establish a connection?

Ans. Connection Establishment

TCP uses a Three way handshaking mechanism to establish a connection between


client and server machines. The three steps in three way handshaking mechanism are
as follows.

SYN: The client sends the first segment, a SYN segment, in which only the SYN flag is set.
This segment is for synchronization of sequence numbers.

SYN + ACK: The server


sends the second
segment, a SYN +ACK
segment, with 2 flag
bits set.

ACK: The client sends


the third segment. This
is just an ACK segment.
It guarantees the
completion of three
way handshaking.

If 2 host
Simultaneously try to establish connection:

Simultaneous Open:

• It's possible for two applications to send a SYN to each other to start a TCP connection,
although the possibility is small, because both sides have to know which port on the
other side to send to. This process is called "Simultaneous Open", or "simultaneous
active open on both sides".
• In a simultaneous open, both applications issue active opens.
• This is a rare situation in which there is no client or server; communication is between
two peers that know their local port numbers.
• Both TCPs go through SYN-SENT and SYN-RCVD states before going to the
ESTABLISHED state.
• Both processes act as client and server.
• The two SYN+ACK segments acknowledge the SYN segments and open the connection.
2. *Explain TCP with respect to flow control and error control

Ans. TCP Flow Control is a protocol designed to manage the data flow Between the user
and the server. It ensures that there is a specific Bandwidth for sending and receiving data
so the data can be processed Without facing any major issues. In order to achieve this, the
TCP Protocol uses a mechanism called the sliding window protocol. Error control in TCP is
mainly done through the use of three simple Techniques :

1. Checksum – Every segment contains a checksum field which is Used to find corrupted
segments. If the segment is corrupted, Then that segment is discarded by the
destination TCP and is Considered lost.
2. Acknowledgement – TCP has another mechanism called Acknowledgement to affirm
that the data segments have been Delivered. Control segments that contain no data but
have Sequence numbers will be acknowledged as well but ACK Segments are not
acknowledged.
3. Retransmission – When a segment is missing, delayed to deliver to a receiver,
corrupted when it is checked by the receiver then that segment is retransmitted again.
Segments are retransmitted only during two events: when the sender
receives three duplicate acknowledgements (ACK) or when a retransmission timer
expires.
3. *Describe the fields of SCTP packet format. Explain SCTP association
establishment process.
Ans. SCTP transmits data in the form of messages and each message
contains one or more packets. The control come before data chunks.

1. Source and Destination port number to enable multiplexing of different


SCTP associations at the same address.
2. A 32-bit verification tag that guards against the insertion of an out-of-date
or false message into the SCTP association.
3. A 32-bit checksum for error detection. The checksum can be either a 32-bit
CRC checksum or Alder-32 checksum.
4. Chunk Layout: A chunk can be either a control chunk or data chunk.
5. SCTP DATA CHUNK: Data chunks are used to send actual data through the
stream and have rather complex headers in some ways, but not really worse
than TCP headers in general.
SCTP Association Establishment Process:-
SCTP association startup and shutdown guidelines are described here.SCTP
association is comprised of a four-way handshake that takes place in the
following order:
i. The client sends an INIT signal to the server to initiate an association.
ii. On receipt of the INIT signal, the server sends an INIT-ACK response to the
client. This INIT-ACK signal contains a state cookie. This state cookie must
contain a Message Authentication Code (MAC), along with a time stamp
corresponding to the creation of the cookie, the life span of the state
cookie, and the information necessary to establish the association. The
MAC is computed by the server based on a secret key only known to it.
iii. On receipt of this INIT-ACK signal, the client sends a COOKIE-ECHO
response, which just echoes the state cookie.
iv. After verifying the authenticity of the state cookie using the secret key, the
server then allocates the resources for the association, sends a COOKIE-
ACK response acknowledging the COOKIE-ECHO signal, and moves the
association to ESTABLISHED state.
4. State the need for
1. Sequence Control
2. Error Control
3. Flow Control in Networking
Ans. Sequence Control

• To ensure connectivity, each byte to be transmitted is numbered. The


sequence number tells the destination which byte in this sequence
comprises the first byte in the segment.
• It helps with the allocation of a sequence number that does not conflict
with other data bytes transmitted over a TCP connection. An ISN is unique
to each connection and separated by each device.
Error Control

• Error Control mechanisms are useful to ensure reliability service of TCP.To


provide reliable service TCP detects and corrects errors.
• Error control mechanisms are useful for detecting corrupted segments,
lost segments, out-of-order segments, and duplicated segments. Error
detection and correction in TCP is achieved through the use of three simple
tools: checksum, acknowledgment, and time-out.
Flow Control

• Flow control make it possible for sender to send the amount of data bytes
that can be sent without worrying an acknowledgment and is one of the
most important duties of the data link layer.
• It ensures that there is a specific Bandwidth for sending and receiving data
so the data can be processed Without facing any major issues.
5. *Demonstrate with suitable example of the call collision of TCP
Ans. The connection is established in TCP using the three-way handshake as
discussed earlier To create a connection. One side, say the server, passively
stays for an incoming link by Implementing the LISTEN and ACCEPT primitives,
either determining a particular other Side or nobody in particular. The other
side performs a connect primitive specifying the I/O Port to which it wants to
join. The maximum TCP segment size available, other options are Optionally
like some private data (example password). The CONNECT primitive transmits
A TCP segment with the SYN bit on and the ACK bit off and waits for a
response. The sequence of TCP segments sent in the typical case, as shown
in the figure below –

When the segment sent by Host-1 reaches the destination, i.e., host -2, the
receiving server Checks to see if there is a process that has done a LISTEN on
the port given in the Destination port field. If not, it sends a response with the
RST bit on to refuse the Connection. Otherwise, it governs the TCP segment to
the listing process, which can accept Or decline the connection.
Call Collision: If two hosts try to establish a connection simultaneously
between the same Two sockets, then the events sequence is demonstrated in
the figure under such Circumstances. Only one connection is established. It
cannot select both the links because Their endpoints identify connections.
Suppose the first set up results in a connection identified by (x, y) and the
second connection are also released up. In that case, only tail enter will be
made, i.e., for (x, y) for the initial sequence number, a clock-based scheme is
used, with a clock pulse coming after every 4 microseconds. For ensuring
additional safety when a host crashes, it may not reboot for sec, which is the
maximum packet lifetime. This is to make sure that no packets fromprevious
connections are roaming around.

You might also like