Network)

17
Homework 3 Course Code : CAP 306 Course Instructor : Ms. JASLEEN Course Tutor : Date Of Allotment : 5 th NOV 2009 D.O.S : 20/11/09 Student Roll No. : D3803b53 Section No. : D3803 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 acknowledgement in made explicitly in the text not has any part become written for me by any other person. KEWAL KRISHAN KAPOOR Evaluater’s comments____________________

Transcript of Network)

Page 1: Network)

Homework 3 Course Code : CAP 306

Course Instructor : Ms. JASLEEN Course Tutor :

Date Of Allotment : 5th NOV 2009 D.O.S : 20/11/09

Student Roll No. : D3803b53 Section No. : D3803

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 acknowledgement in made explicitly in the text not has any part become written for me by any other person.

KEWAL KRISHAN KAPOOR

Evaluater’s comments____________________

Marks Obtained ___________ Out Of ____________

Page 2: Network)

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 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0xABCC 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 00x02BC 0 0 0 0 0 0 1 0 1 0 1 1 1 1 0 00xEEEE 1 1 1 0 1 1 1 0 1 1 1 0 1 1 1 0

1 1 0 0 0 1 0 0 1 0 1 0 0 1 0 0

Complement 0 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 2 B 5 B

sending code is :0x 3456,0xABCC, 0x2BC,0xEEEE,0x2B5B

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

0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 0

0 0 0 0 0 0 1 0 1 0 1 1 1 1 0 00 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Complement: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Therefore checksum at receiver site is 2B5B

Page 3: Network)

c. Find the checksum at the receiver site if the second data item is changed toOxABCE.

ABCE= 1 0 1 0 1 0 1 1 1 1 0 0 1 1 1 00 0 1 1 0 1 0 0 0 1 0 1 0 1 1 01 0 1 0 1 0 1 1 1 1 0 0 1 1 1 00 0 0 0 0 0 1 0 1 0 1 1 1 1 0 01 1 1 0 1 1 1 0 1 1 1 0 1 1 1 00 0 1 0 1 1 1 0 0 0 1 1 0 0 1 0

carrry bit 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10

0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0complement: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1

data is corrupted

d. Find the checksum at the receiver site if the second data item is changed toOxABCE and the third data item is changed to Ox02BA.

ABCC changes to ABCE & 02BC changes to 02BA.checksum at receiver site:ans:data item:3456,ABCE,02BA,EEEE,2E32

0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 01 0 1 0 1 0 1 1 1 1 0 0 1 1 1 00 0 0 0 0 0 1 0 1 0 1 1 1 0 1 01 1 1 0 1 1 1 0 1 1 1 0 1 1 1 00 0 1 0 1 1 1 0 0 0 1 1 0 0 1 0

carry bit 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1complement: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

data is error free at receiving site.s

Page 4: Network)

Q2: Compare and contrast byte-stuffing and bit-stuffing. Which technique is used inbyte-oriented protocols? Which technique is used in bit-oriented protocols?.

ANS:

Bit stuffing

Inserting bits in data in order to break up a bit pattern that may cause the transmission to go out of synchronization. For example, in T1 lines, timing is maintained by detecting a change from 0 to 1. If too many zero bits are transmitted consecutively, the receiving end may lose synchronization because too much time has passed without sensing voltage. Therefore, in long strings of zeros, a set of bits that begins with a 1 and functions as a timing signal is "stuffed" into the stream of zeros at certain intervals.

A protocol which guarantees the receiver of synchronous data can recover the sender's clock. When the data stream sent contains a large number of adjacent bits which cause no transition of the signal, the receiver cannot adjust its clock to maintain proper synchronised reception. To eliminate the possibility of such a pathological case, when a preset number of transitionless bits have been transmitted, a bit which does cause a transition is "stuffed" (transmitted) by the sender. The receiver follows the same protocol and removes the stuffed bit after the specified number of transitionless bits, but can use the stuffed bit to recover the sender's clock.

The advantage of bit stuffing is that only a bit (not a byte) is inserted in the data stream, and that only when the content of the data stream fails to provide a timing signal to the receiver. Thus very nearly 100% of the bits transported are useful data. In contrast, asynchronous transmission of data "throws away" a start bit and one or more stop bits for each data byte sent.

Byte stuffing

Although using characters to mark the beginning and end of each frame has advantages, most computer networks cannot afford to reserve characters for use by the network. Instead, the network permits an application to transfer arbitrary data values across the network. In particular, an application may choose to send data that contains one or more occurrences of characters like soh and eot that are used for framing. In general, to distinguish between data being sent and control information such as frame delimiters, network systems arrange for the sending side to change the data slightly before it is sent, and then arrange for the receiving side to restore the original data before passing it to the receiving application.

Thus, although applications using the network can transfer arbitrary data, the network system never confuses data with control information. Because network systems usually insert bits or bytes to change data for transmission, the technique is known as data stuffing. The terms character stuffing and byte stuffing refer to data stuffing used with character oriented hardware, and bit stuffing which is more common, refers to data stuffing used with bit oriented hardware. To implement byte stuffing, a sender must scan an entire data block and perform the mapping before any data is sent. Byte stuffing can solve the problem by reserving a third character to mark occurrences of special characters in the data.

Page 5: Network)

bit stuffing technique is used in bit oriented protocolsbyte stuffing technique is used in byte-oriented protocols.

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

ANS:(a) Frame 0 is sent ; frame 0 is acknowledged

frame0

ack 0

(b) Frame 1 & 2 are sent; frames 1 and 2 are acknowledged

frame 1

ack 1 frame 2

ack 2

A B

A B

Page 6: Network)

(c) Frames 3,4, 5 are sent; NAK 4 is received

frame 3

ack 3

frame 4

frame 5

ack 5

(d) Frames 4, 5,6,7 are sent, frames 4 through 7 are acknowledged

frame 4

ack 4

frame 5

ack 5

frame 6

ack 6

frame 7

ack 7

A

L

B

A B

Page 7: Network)

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.

ANS: distance=speed x time=>time=speed/distancespeed of light=3.8 x10 8

time=4x103/3 x 108=>1.3 x 10-5

PART B

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

Ans:

In telecommunications and computer networks, a virtual circuit (VC), synonymous with virtual connection and virtual channel, is a connection oriented communication service that is delivered by means of packet mode communication. After a connection or virtual circuit is established between two nodes or application processes, a bit stream or byte stream may be delivered between the nodes. A virtual circuit protocol hides the division into segments, packets or frames from higher level protocols.

Virtual circuit communication resembles circuit switching, since both are connection oriented, meaning that in both cases data is delivered in correct order, and signalling overhead is required during a connection establishment phase. However, circuit switching provides constant bit rate and latency, while these may vary in a virtual circuit service because of reasons such as:• varying packet queue lengths in the network nodes, • varying bit rate generated by the application, • varying load from other users sharing the same network resources by means of statistical multiplexing, etc.

Many virtual circuit protocols, but not all, provide reliable communication service, by means of data retransmissions because of error detection and automatic repeat request (ARQ).Switched virtual circuits (SVCs) are generally set up on a per-call basis and are disconnected when the call is terminated; however, a permanent virtual circuit (PVC) can be established as an option to provide a dedicated circuit link between two facilities. PVC configuration is usually preconfigured by the service provider. Unlike SVCs, PVC are usually very seldom broken/disconnected.

A switched virtual circuit (SVC) is a virtual circuit that is dynamically established on demand and is torn down when transmission is complete, for example after a phone call or a file

Page 8: Network)

download. SVCs are used in situations where data transmission is sporadic and/or not always between the same data terminal equipment (DTE) endpoints.A permanent virtual circuit (PVC) is a virtual circuit established for repeated/continuous use between the same DTE. In a PVC, the long-term association is identical to the data transfer phase of a virtual call. Permanent virtual circuits eliminate the need for repeated call set-up and clearing.Frame relay is typically used to provide PVCs. ATM provides both switched virtual connections and permanent virtual connections, as they are called in ATM terminology. X.25 provides both SVCs and PVCs, although not all X.25 service providers or DTE implementations support PVCs as their use was much less common than SVCs.

virtual packet switching circuits

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.

Page 9: Network)

Q2.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?

The worst case would be when a station wants to transmit (just after its bit slot ispassed), and all of the other stations are transmitting. Then, on the next pass all thestations are transmitting again, and station, s, is the very last station on the map. So first ithas 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.

ii)Mok and Ward’s Protocol with permuting Virtual station Numbers.?

As an example of the worst case scenario with the Mok and Ward protocol, consider 8stations 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 frontof the line one step at a time.. After each countdown, oneframe 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

Q3.How a slotted ALOHA type of satellite packet broadcasting network is an improvement over pure ALOHA.

Pure Aloha Protocol

With Pure Aloha, stations are allowed access to the channel whenever they have data to transmit. Because the threat of data collision exists, each station must either monitor its transmission on the rebroadcast or await an acknowledgment from the destination station. By comparing the transmitted packet with the received packet or by the lack of an acknowledgement, the transmitting station can determine the success of the transmitted packet. If the transmission was unsuccessful it is resent after a random amount of time to reduce the probability of re-collision.

Page 10: Network)

Advantages:

· Superior to fixed assignment when there is a large number of bursty stations.

· Adapts to varying number of stations.

Disadvantages:

· Theoretically proven throughput maximum of 18.4%.

· Requires queueing buffers for retransmission of packets.

Slotted Aloha Protocol

synchronous system: time divided into slots slot siz equals fixed packet transmission time when Packet ready for transmission, wait until start of next slot packets overlap completely or not at all

By making a small restriction in the transmission freedom of the individual stations, the throughput of the Aloha protocol can be doubled. Assuming constant length packets, transmission time is broken into slots equivalent to the transmission time of a single packet. Stations are only allowed to transmit at slot boundaries. When packets collide they will overlap completely instead of partially. This has the effect of doubling the efficiency of the Aloha protocol and has come to be known as Slotted Aloha.

Advantages:

Page 11: Network)

· Doubles the efficiency of Aloha.· Adaptable to a changing station population.

Disadvantages:

· Theoretically proven throughput maximum of 36.8%.· Requires queueing buffers for retransmission of packets.

Q4.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?

Ans:

The asynchronous problem arise between sender and receiver. this problem can be resolved by the flow control.In computer networking, flow control is the process of managing the rate of data transmission between two nodes to prevent a fast sender from outrunning a slow receiver. It provides a mechanism for the receiver to control the transmission speed, so that the receiving node is not overwhelmed with data from tranceiving nodes. Flow control should be distinguished from congestion control, which is used for controlling the flow of data when congestion has actually occurred. Flow control mechanisms can be classified by whether or not the receiving node sends feedback to the sending node.Flow control is important because it is possible for a sending computer to transmit information at a faster rate than the destination computer can receive and process them. This can happen if the receiving computers have a heavy traffic load in comparison to the sending computer, or if the receiving computer has less processing power than the sending computer.

Q5.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?

Ans:

Every station in a token ring network is either an active monitor (AM) or standby monitor (SM) station. However, there can be only one active monitor on a ring at a time. The active monitor is chosen through an election or monitor contention process.

The monitor contention process is initiated when

1. a loss of signal on the ring is detected. 2. an active monitor station is not detected by other stations on the ring. 3. when a particular timer on an end station expires such as the case when a station hasn't

seen a token frame in the past 7 seconds.

Page 12: Network)

When any of the above conditions take place and a station decides that a new monitor is needed, it will transmit a "claim token" frame, announcing that it wants to become the new monitor. If that token returns back to the sender, it is OK for it to become the monitor. If some other station tries to become the monitor at the same time then the station with the highest mac address will win the election process. Every other station becomes a standby monitor. All stations must be capable of becoming an active monitor station if necessary.

The active monitor performs a number of ring administration functions. The first function is to operate as the master clock for the ring in order to provide synchronization of the signal for stations on the wire. Another function of the AM is to insert a 24-bit delay into the ring, to ensure that there is always sufficient buffering in the ring for the token to circulate. A third function for the AM is to ensure that exactly one token circulates whenever there is no frame being transmitted, and to detect a broken ring. Lastly, the AM is responsible for removing circulating frames from the ring.