Home Work-3

CAP306: Computer Networks

SUBMITTED TO: Lect. Jasleen

SUBMITTED BY:SURENDRA MCA 3nd SEM ROLL NO- D3804A15 REGD NO- 10806601

Declaration: I declare that this assignment is my individual work. I have not copied from any other student’s work or from any other source except where due acknowledgment is made explicitly in the text, nor has any part been written for me by another person. Student’s Signature surendra

Evaluator’s comments: _____________________________________________________________________ Marks obtained : ___________ out of ______________________

PART A

Que1: A sender needs to send the four data items Ox3456, OxABCC, Ox02BC, and OxEEEE. Answer the following: a. Find the checksum at the sender site.

conversion of hexa to binary:
0x3456= 0xABCC= 0x02BC= 11 100 101 110 1010 1011 1100 1100 010 1011 1100

0xEEE=1110 1110 1110 1110

Checksum at sender:
1 1100101110 1010101011001100 01010111100 1 1 10 1 1 1 0 1 1 1 0 1 1 1 0 1 10 0 0 1 0 0 1 0 1 0 0 1 0 0 Comp 0011101101 011011

after making 4-bit combination code will be=2B5B sending code is :0x 3456,0xABCC, 0x2BC,0xEEEE,0x2B5B

b.

Find the checksum at the receiver site if there is no error.

at receiver:
if there is no error then it means all bits are 0’s 1 1100101110 1010101011001100 01010111100 1 1 10 1 1 1 0 1 1 1 0 1 1 1 0 checksum = 0 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 1111 111111111111 comp: 0000 000000000000

therefore checksum at recever site is 2B5B

Que2: Compare and contrast byte-stuffing and bit-stuffing. Which technique is used in byte-oriented protocols? Which technique is used in bit-oriented protocols? ANSWER: byte-stuffing 1. Also referred to as character stuffing. ASCII
characters are used as framing delimiters (e.g. DLE STX and DLE ETX) 2. The problem occurs when these character patterns occur within the “transparent” data. Solution: sender stuffs an extra DLE into the data stream just before each occurrence of an“accidental” DLE in the data stream. 3, The data link layer on the receiving end unstuffs the DLE before giving the data to the network layer.

bit-stuffing
1. Each frame begins and ends with a special bit pattern called a flag byte [01111110]. 2. Whenever sender data link layer encounters five consecutive ones in the data stream, it automatically stuffs a 0 bit into the outgoing stream. 3. When the receiver sees five consecutive incoming ones followed by a 0 bit, it automatically dyestuffs the 0 bit before sending the data to the network layer.

The ddcmp frame is simpler than of bsc. Each ddcmp frame is assigned a unique number, and crc-16 protocol is used for error detection. The ARQ technique is used for error recovery (i.e. error correction ).

Que3 :Draw the sender and receiver windows for a system using go-back –n ARQ given the following:• Frame 0 is sent ; frame 0 is acknowledged • Frame 1 & 2 are sent; frames 1 and 2 are acknowledged • Frames 3,4, 5 are sent; NAK 4 is received • Frames 4, 5,6,7 are sent, frames 4 through 7 are acknowledged ANSWER:

Que4: Computer A uses stop-and-wait ARQ protocol to send packets to compute B . If the distance between A and B is 4000km, how long does it take computer A to receive acknowledgement for a packet? Use the speed of light for propagation speed and assume time between receiving & sending acknowledgment is 0. ANSWER:
distance=speed x time=>time=speed/distance speed of light=3.8 x10 -8 time=3 x 10-8/4x103=>0.7 x 10-11

PART B

1. A message is broken up into three pieces .Discuss the transmission of packets using switched virtual circuits Answer :

Packet-switched communication between systems A and D

(The message in this case has been broken into three parts labeled 1-3) Virtual circuit switching is a packet switching methodology whereby a path is established between the source and the final destination through which all the packets will be routed during a call. This path is called a virtual circuit because to the user, the connection appears to be a dedicated physical circuit. However, other communications may also be sharing the parts of the same path. Before the data transfer begins, the source and destination identify a suitable path for the virtual circuit. All intermediate nodes between the two points put an entry of the routing in their routing table for the call. Additional parameters, such as the maximum packet size, are also exchanged

between the source and the destination during call setup. The virtual circuit is cleared after the data transfer is completed. Virtual circuit packet switching is connection orientated. This is in contrast to datagram switching, which is a connection less packet switching methodology. Advantages of virtual circuit switching are: Packets are delivered in order, since they all take the same route; The overhead in the packets is smaller, since there is no need for each packet to contain the full address; The connection is more reliable, network resources are allocated at call setup so that even during times of congestion, provided that a call has been setup, the subsequent packets should get through; Billing is easier, since billing records need only be generated per call and not per packet.

2. How long does a stations, have to wait in the worst case before it can start transmitting its frame over a LAN that uses i) The basic Bit-map Protocol? ii) Mok and Ward’s Protocol with permuting Virtual station Numbers? ANSWER:
(1) The worst case would be when a station wants to transmit (just after its bit slot is passed), and all of the other stations are transmitting. Then, on the next pass all the stations are transmitting again, and station, s, is the very last station on the map. So first it

has to wait for (N-1) frame slot, then entire N bit-slot (contention period), and another (N-1) frame slot, so total waiting time is N+2(N-1)d bit slots.

(2)
As an example of the worst case scenario with the Mok and Ward protocol, consider 8 stations arranged in virtual priority order of A, B, C, D, E, F, G, S with priority (7,6,5,4,3,2,1,0). The worst case will occur when every station wants to transmit a frame. The protocol will allow every station in front of S to transmit, shifting S towards the front of the line one step at a time. So S will be forced to wait through N contention countdowns, each of which takes é Nù 2 log bits to complete. After each countdown, one frame will be transmitted. So in total, S will have to wait through N contention countdowns and N-1 frame transmissions of length d bits as each other station goes ahead of S. In total, this takes (N é Nù 2 log ) + (N-1)d bits in the worst case.

3.How a slotted ALOHA type of satellite packet broadcasting network is an improvement over pure ALOHA. ANSWER: ALOHAnet, also known as ALOHA, was a pioneering computer networking
system developed at the University of Hawaii. It was first deployed in 1970, and while the network itself is no longer used, one of the core concepts in the network is the basis for the widely used Ethernet. The ALOHA protocol is an OSI layer 2 protocol for LAN networks with broadcast topology. The first version of the protocol was basic: 1. If you have data to send, send the data 2. If the message collides with another transmission, try resending "later". Pure Aloha had a maximum throughput of about 18.4%. This means that about 81.6% of the total available bandwidth was essentially wasted due to losses from packet collisions. The basic throughput calculation involves the assumption that the aggregate arrival process follows a Poisson distribution with an average number of arrivals of 2G arrivals per 2X seconds.

Therefore, the lambda parameter in the Poisson distribution becomes 2G. The mentioned peak is reached for G = 0.5 resulting in a maximum throughput of 0.184, i.e. 18.4%. With Slotted Aloha, a centralized clock sent out small clock tick packets to the outlying stations. Outlying stations were only allowed to send their packets immediately after receiving a clock tick. If there is only one station with a packet to send, this guarantees that there will never be a collision for that packet. On the other hand if there are two stations with packets to send, this algorithm guarantees that there will be a collision, and the whole of the slot period up to the next clock tick is wasted. With some mathematics, it is possible to demonstrate that this protocol does improve the overall channel utilization, by reducing the probability of collisions by a half. An improvement to the original Aloha protocol was Slotted Aloha, which introduced discrete timeslots and increased the maximum throughput to 36.8%. A station can send only at the beginning of a timeslot, and thus collisions are reduced. In this case, the average number of aggregate arrivals is G arrivals per 2X seconds. This leverages the lambda parameter to be G. The maximum throughput is reached for G = 1. Slotted Aloha is used on low bandwidth tactical Satellite communications networks by the US Military, subscriber based Satellite communications networks, and contactless RFID technologies. So it should be noted that Aloha's characteristics are still not much different from those experienced today by Wi-Fi, and similar contention-based systems that have no carrier sense capability. There is a certain amount of inherent inefficiency in these systems. For instance 802.11b sees about a 2-4 Mbit/s real throughput with a few stations talking, versus its theoretical maximum of 11 Mbit/s. It is typical to see these types of networks' throughput break down significantly as the number of users and message burstiness increase.

3. Problem that can arise if receiving of frames is slower at receiver end as compare to sending of frames at sender end? How it can be resolved? ANSWER:
When the frames sending speed is greater at end of sender compare to the receiving of frames at the end of receiver. Then the request of the sender to send the frames to receiver is going to the waiting state. And the frames are stored in the transmission media i.e. buffer of the receiver end.

4.

What conditions would have to hold for a corrupted frame to circulate forever on a token ring without a monitor? How does the monitor fix the problem?