Top Banner
QB on IT for TY BSc. (IT) Vinod Vaze’s Question Bank on Internet Technology Specially designed for Sixth Semester B.Sc. (IT) Students These notes are prepared for student’s personal use. Any commercial use of this material is strictly prohibited. © vinod vaze
161
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Vinod Vaze’s

Question Bankon

Internet Technology

Specially designed for Sixth Semester B.Sc. (IT) Students

These notes are prepared for student’s personal use.

Any commercial use of this material is strictly prohibited.

© vinod vaze

Page 2: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Guide to solution code

Sr. No.Starting

with:

Chapter

001 TCP / IP (Transmission Control / Internet protocol)

101 ARP (Address Resolution Protocol)

201 RARP (Reverse Address Resolution Protocol)

301 RIP (Routing Information Protocol)

401 OSPF (Open Shortest Path First) Protocol

501 BGP (Border Gateway Protocol)

601 Socket Programming (using TCP and UDP socket)

701 RMI (Remote Method Invocation)

801 CORBA

901 Wireless LAN

© vinod vaze

Page 3: Vaze's QB on IT

QB on IT for TY BSc. (IT)

TCP / IP (Transmission Control / Internet protocol)

001 What is fragmentation? Why is it required to fragment an IP datagram? Explain the functions of the following fields related to fragmentation in an IP Datagram:i) Identificationii) Flagsiii) Fragmentation Offset.Explain fragmentation offset with an example. (May 2006)

Answer: A datagram can travel through different networks. Each router de-capsulates the IP datagram from the frame it receives, processes it and then encapsulates it in another frame. The format and size of the received frame depends on the protocol used by the physical network though which the frame has just traveled.

In order to make the IP protocol independent of the physical network, the packagers decided to make the maximum length of the IP datagram equal to the largest maximum transfer unit (MTU) i.e. 65535 bytes. This makes transmission more efficient if we use a protocol with an MTU of this size. However, for other physical networks, we must divide the datagram to make it possible to pass through these networks. This is called fragmentation.

A datagram can be fragmented by the source host or any router in the path. The reassembly of the datagram, however, is done only by the destination host because each fragment becomes an independent datagram. Whereas the fragmented datagram can travel through different routes, but all fragments belonging to the same datagram should finally arrive at the destination host.

When a datagram is fragmented, following fields are updated:a) Required parts of the header must be copied by all

fragments.b) The option field may or may not be copied.c) The host or router that fragments the datagram must change

the values of total length, Flags & Fragmentation Offset.d) Value of checksum must be recalculated.e) Rest of the fields must be copied.

Identification:

8

© vinod vaze

Page 4: Vaze's QB on IT

QB on IT for TY BSc. (IT)

a) 16-bit field that identifies a datagram originating from the source host.

b) The combination of the identification and the source IP must uniquely define a datagram as it leaves the source host. To guarantee uniqueness, the IP protocol uses a counter to label the datagrams.

c) When the IP protocol sends a datagram, it copies the current value of the counter to the identification field and increments the counter by one.

d) As long as the counter remains in the memory, uniqueness is guaranteed. When a datagram is fragmented, the value in the identification field is copied into all fragments.

e) The identification number helps in reassembling the datagram since all fragments with the same identification number should be assembled into one datagram.

Flags:It is a 3-bit field. Following are the bits:

a) The first is a reserved bit.b) The second bit is called the ‘Do not fragment’ bit. If the value

is 1, the machine must not fragment the datagram. If it cannot pass the datagram through any available physical network, it discards the datagram and sends an ICMP error message to the source. If the value is 0, the datagram can be fragmented.

c) The third bit is called the ‘More fragment’ bit. It its value is 1, then the datagram is not the last fragment, there are more fragments after this one. But if the value is 0, it means that this is the last or only fragment.

Fragmentation Offset: This is a 13-bit field. It shows the relative position of this fragment with respect to the whole datagram. If each fragment follows a different path and arrives out of order, the final destination host can reassemble the original datagram from the fragments received using the following strategy

a) The first fragment has an offset field value of zero.b) Divide the length of the first fragment by 8. The second

fragment has an offset value equal to that result.c) Divide the total length of the first and second fragment by 8.

The third fragment has an offset value equal to that result.d) Continue the process. The last fragment has a ‘more bit’

value of 0.

Example:

© vinod vaze

Page 5: Vaze's QB on IT

QB on IT for TY BSc. (IT)

A datagram of 4000 bytes fragmented into 3 fragments. The bytes in the original datagram are numbered from 0 to 3999. The first fragment carries bytes 0 to 1399. The offset for this datagram is 0/8=0. The second fragment carries bytes 1400 to 2799. The offset value is 1400/8 =175. The third fragment carries bytes 2800 to 3999. The offset value for this fragment is 2800/8=350.The value of the offset is measured in units of 8 bytes.

002 How does transmission control protocol avoid congestion? Explain in detail. (October 2005)

An internet is a combination of networks and connecting devices (e.g., routers). A Packet started at sender may pass through several routers before reaching its final destination. A router has a buffer that stores the incoming packets, processes them and Forwards them.

If a router receives packets faster than it can process, congestion might occur and some packets could be dropped.

To avoid congestion, the sender TCP uses 2 strategies.

a) Slow Start and Addictive Increaseb) Multiplicative decrease

Slow Start1. At the beginning of a connection, TCP sets the congestion window

size to the maximum segment size. 2. For each segment that is acknowledged, TCP increases the size of

the congestion window by one maximum segment size, until it reaches a threshold of half the allowable window size. This is called slow start.

3. Here the size of the congestion window increases exponentially.

Addictive Increasea) To avoid congestion before it happens, one must slow down

this exponential growth.b) After the size reaches the threshold, the size is increased one

segment for each acknowledgement even if an acknowledgement is for several segments.

4. This additive increase strategy continues as long as the acknowledgements arrive before their corresponding time-outs or the congestion window size reaches the receiver window value.

Multiplicative Decrease a) If congestion occurs, the congestion window size must be

© vinod vaze

Page 6: Vaze's QB on IT

QB on IT for TY BSc. (IT)

decreased. A Lost segment indicates that congestion has occurred. If the sender does not receive an acknowledgement for a segment before its retransmission timer has matured, it assumes that there is congestion.

b) This strategy says that, if a time-out occurs, the threshold

c) Must be set to half of the last congestion window size, and the congestion window size should start from one again. Thus the sender returns to the slow start phase.

c) The size of threshold is reduced to half each time a time-out occurs. Thus the size of the threshold is reduced exponentially (multiplicative decrease).

Explanation:

In the above Figure, we assume that the maximum window size is 32 segments. The threshold is set to 16 segments (half of the window size). In the slow start procedure, the window size starts from 1 and grows exponentially until it reaches the threshold with the condition that there is no timeout. After reaching the threshold, the additive increase procedure allows the window size to increase linearly until a timeout occurs or the maximum window size is reached.

In the above drawn figure, the timeout occurs what the segment 8 is sent. At this moment, the multiplicative decrease procedure takes over and reduces the threshold to half of the previous window size. The previous window size was when the timeout happened so the new threshold is now 10.

003 Draw the TCP state transition diagram. Explain the states, which the

© vinod vaze

Page 7: Vaze's QB on IT

QB on IT for TY BSc. (IT)

TCP client can attain.

Ans:

© vinod vaze

Page 8: Vaze's QB on IT

QB on IT for TY BSc. (IT)

State Description

CLOSED There is no connectionLISTEN Passive open received; waiting for SYNSYN-SENT SYN sent; waiting for ACKSYN-RCVD SYN+ACK sent; waiting for ACKEATABLISHED Connection established; data transfer in progressFIN-WAIT-1 First FIN sent; waiting for ACKFIN-WAIT-2 ACK to first FIN received; waiting for second FINCLOSE-WAIT First FIN received, ACK sent; waiting for application to closeTIME-WAIT Second FIN received, ACK sent; waiting for 2MSL time-outLAST-ACK Second FIN sent; waiting for ACKCLOSING Both sides have decided to close simultaneously

004 Distinguish between Transmission Control Protocols and User Datagram Protocol User Datagram Protocol.

Ans:

Parameter TCP UDP1 Common in both UDP and TCP are transport-layer protocols

that create a process-to-process communication

2 Reliability Reliable UDP is an unreliable protocol

3 Expand the acronym

Transmission Control Protocol

User Datagram Protocol

4 Orientation Byte oriented Message oriented5 Connection

orientationConnection

orientedConnectionless

6 Overheads Considerable Little7 Speed Slower Faster8 Protocol Data

unitThe TCP packet is called a segment.

The UDP packet is called a user datagram.

9 Flow control mechanism

TCP uses a sliding window mechanism for flow control.

UDP has no flow control mechanism at all.

10 Error control TCP provides error control. Byte oriented.

UDP has no Error control mechanism at all.[Only checks the UDP

© vinod vaze

Page 9: Vaze's QB on IT

QB on IT for TY BSc. (IT)

header by checksum]11 Error Detection

and correction Mechanism

Error detection is handled in TCP by the checksum, CRC acknowledgment, and time-out. Congestion control

No Acknowledgement,

No guaranteed delivery

No sequence guarantee

No congestion control

12 Timers TCP uses four timers—retransmission, persistence, keep-alive, and time-waited — in its operation.

Nothing of this sort.

13 Preference & Use

TCP is preferred & used for:Reliable, byte-stream delivery between processes.

UDP is preferred & Used for one-shot, client-server type request-reply queries, Example: DNS

Where prompt delivery is more important than accurate delivery, such as: Transmitting speech or video

Transmission of Real time data

Can be used by a system having its own error correction and flow correction mechanism such as TFTP, RIP & SNMP

14 Headers & Overheads:

The TCP header is much larger than the UDP header

The UDP header is much smaller than the TCP header

15 Example of application

TELNET DNS

16 Connection Required to have explicit connection between the hosts.

No prior connection at all: It is connectionless

© vinod vaze

Page 10: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Three Way Handshake

17 Latest trends Use SCTP [Stream Control Transmission Protocol] which combines the good features of both TCP and UDP

005 Define Internet Protocol Datagram in detail

Ans: Packets in the IP layer are called datagram’s. A datagram is variable – length packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and contains information essential to routing and delivery. It is customary in TCP/IP to show the header in 4 bytes sections. A brief description of each field is in order.

Version (VER): These 4 bits define the version of IP protocol. Currently the version is 4. However, version 6 may totally replace version 4 in the future. This field tells the IP software running in the processing machine that the datagram has the format of version 4. All fields may be interpreted as specified in the 4th version of the protocol. If the machine is using some other version of IP datagram is discarded rather than

© vinod vaze

Page 11: Vaze's QB on IT

QB on IT for TY BSc. (IT)

interpreted incorrectly.

Header length (HLEN): This 4 bit field defines the total length of the datagram of header in 4-byte word. This field is needed because the length of the header is variable. When there are no options, the header length is 20 bytes, and the value of the field is 5. When the option is field at its maximum size, the value of this field is 15.

Differentiated services (DS): IETF has changed the interpretation and name of this bit field. This field, previously called service type, is now called differentiated services. Total length: This is 16-bit field that defines the total length of IP datagram in bytes. To find the length of data coming from the upper layer, subtract the header length from the total length. The header length can be founded by multiplying the value in the HLEN field by 4.

The total length field defines the total length of the datagram including the header.

006 An IP packet has arrived with the first 8 bits as shown:<---------------01000010The receiver discards the packer? Why?

Ans:

There is an error in this packet. The 4 left most bits (0100) show the version, which is correct. The next 4 bits 0010) show the wrong header length (2*4=8). The minimum number of bytes in the header must be 20.The packet has been corrupted in transmission.

007 What are the different timers that TCP uses? How do we calculate the retransmission time and the round trip time?

Ans:

TCP TIMERS

© vinod vaze

Timers

Retransmission Persistence Keep alive TIME-WAIT

Page 12: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Retransmission Timer : To retransmit a lost segment, TCP employs a retransmission timer that handles the retransmission time-out (RTO), the waiting time for an acknowledgement of a segment. When TCP sends a segment, it creates a retransmission timer for that particular segment. Two situations may occur:

1. If an acknowledgement is received for this particular segment before the timer goes off, the timer is destroyed.

2. If the timer goes off before the acknowledgement arrives, the segment is retransmitted and the timer is reset.

Round trip time (RTT):To calculate the retransmission time-out (RTO), we first need to calculate the round-trip time (RTT). However, calculating RTT in TCP is an involved process that we explain step by step with some examples.

Measured RTT we need to find how long it takes to send a segment and receive an acknowledgement for it. This is the measured RTT. We need to remember that the segment and their acknowledgements do not have a one-to-one relationship; several segments mat be acknowledged together. The measured round trip time for a segment is the time required for the segment to reach the destination and be acknowledged, although the acknowledgement may include other segments. Note that in TCP, only one RTT measurement can be in progress at any time.

This means that if any RTT measurement is started, no other measurement starts until the value of this RTT is finalized. We use the notation RTTM to stand for measured RTT.

008 What are the services offered by the Transmission Control Protocol to the processes an Application layer? Explain any two devices.

Ans:

The services offered by the Transmission Control Protocol to the processes an Application layer are as follows:1. Process- To-Process communication2. Stream delivery Service3. Connection-Oriented Service4. Full-Duplex Communication5. Reliable Service6. Process-To-Process Communication

© vinod vaze

Page 13: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Like UDP, TCP provides process-to-process communication using port numbers

Port Protocol Description7 Echo Echoes a received datagram back to the sender9 Discard Discards any datagram that is received11 Users Active users13 Daytime Returns the date and time17 Quote Returns the quote of the day19 Chargen Returns a string of characters20 FTP, Data File Transfer Protocol (data connection)21 FTP, Control File Transfer Protocol (control connection)23 TELNET Terminal Network25 SMTP Simple Mail Transfer Protocol53 DNS Domain Name server67 BOOTP Bootstrap Protocol79 Finger Finger80 HTTP Hypertext Transfer Protocol111 RPC Remote Procedure Call

Connection-Oriented Service:

TCP, unlike UDP, 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:

a) The two TCPs establish a connection between them.b) Data are exchanged in both directions.c) The connection is terminated.

Note that this is a virtual connection, not a physical connection. The TCP segment is encapsulated in an IP datagram and can be send out of order, or lost, or corrupted, and then resent. Each may use a different path to reach the destination. There is no physical connection. TCP creates a stream-oriented environment in which it accepts the responsibility of delivering the bytes in order to the other site. The situation is similar to creating a bridge that spans multiple islands and passing all of the bytes from one island to another in one single connection.

009 Transmission Control Protocol is a Connection-Oriented Protocol. How does it terminate the connection? Explain in detail the process of connection termination.

Ans:

Any of the two parties involved in exchanging data (client or server) can

© vinod vaze

Page 14: Vaze's QB on IT

QB on IT for TY BSc. (IT)

close the connection, although it is usually initiated by the client. Most implementation today allows two options for connection termination: three-way handshake and four-way handshake with a half-close option.

Three-Way Handshaking:

Most implementation today allow three-way handshaking for connection termination

a) In a normal situation, the client TCP, after receiving a close command from the client process, sends the first segment, a FIN segment in which the FIN flag is set. Note that a FIN segment can include the last chunk of the data sent by the client or it can be just a control segment. If it is only a control segment, it consumes only one sequence number.

b) The server TCP after receiving the FIN segment informs its process of the situation and sends the second segment, a FIN+ACK segment, to confirm the receipt of the FIN segment from the client and at the same time to announce the closing of the connection in the other direction. This segment can also contain the last chunk of data from the server. If it does not carry data, it consumes only one sequence number.

c) The client TCP sends the last segment, an ACK to confirm the receipt of the FIN segment from the TCP server. This segment contains the acknowledgement number, which is one plus the sequence number received in the FIN segment from the server. This segment cannot carry data and consumes no sequence numbers.

Half-Close:In TCP, one end can stop sending data while still receiving data. This is called a half-close. Although either end can issue a half-close, it is normally initiated by the client. It can occur when the server needs all the data before processing can begin. A good example is sorting. When the client sends all the data to the server to be sorted, the server needs to receive all the data before sorting can start. This means the client, after sending all data, can close the connection in the outbound direction. However, the inbound direction must remain open to receive the sorted data. The server, after receiving the data still needs time for sorting; its outbound direction must remain open.

The client half-closes the connection by sending a FIN segment. The server accepts the half-close by sending the ACK segment. The data

© vinod vaze

Page 15: Vaze's QB on IT

QB on IT for TY BSc. (IT)

transfer from the client to the server stops. The server, however, can still send data. When the server has sent all of the process data, it sends a FIN segment, which is acknowledged by an ACK from the client.

After half closing the connection, data can travel from the server to the client and acknowledgements can travel from the client to the server. The client cannot send more data to the server. Note the sequence numbers we have used. The second segment (ACK) consumes no sequence numbers. Although the client has received sequence number Y-1 and is expecting Y, the server sequence number is still Y-1. When the connection finally closes, the sequence number of the last ACK segment is still X, because no sequence numbers are consumed during data transfer in that direction.

010 Transmission control protocol is a connection-oriented protocol. How does it establish the connection? Explain in details the process of connection establishment?

Ans:

TCP is a connection-oriented. A connection-oriented transport protocol establishes a virtual path between the source and destination. All of the segments belonging to message are then send over this virtual path. Using a single pathway for the entire message facilities the acknowledgement process as well as retransmission of damaged or lost frames. You may wonder how TCP, which uses the services of IP to deliver individual segments to the receiver, but it, controls the connection itself. The point is that the TCP connection is virtual, not physical. TCP operates at higher level. TCP uses the services of IP to deliver individual segments to the receiver, but it controls the connection itself. If a segment is lost or corrupted, it is retransmitted. Unlike TCP, IP is unaware of this retransmission. If a segment arrives out of order, TCP holds it until the missing segment arrives; IP is unaware of this reordering.

In TCP, connection-oriented transmission requires three phases: connection establishment, data transfer and connection termination.

Connection Establishment:

TCP transmits data in full-duplex mode. When two TCPs in two machines are connected, they are able to send segments to each other simultaneously. This implies that each party must initialize communication and get approval from the other party before any data is transferred.Three-Way Handshake:The connection establishment in TCP is called three-way handshake. In

© vinod vaze

Page 16: Vaze's QB on IT

QB on IT for TY BSc. (IT)

our example application program, called the client, wants to make a connection with another application program, called the server, using TCP as the transport layer protocol.The process starts with the server. The server program tells its TCP that it is ready to accept the connection. This is called a request for a passive open. Although the server TCP is ready to accept any connection from any machine in the world it cannot make the connection itself.The client program issues a request for an active open. A client that wishes to connect to an open server tells its TCP that it needs to be connected to a particular server. TCP can now start a three-way handshake process. Each segment has values for all its header fields and perhaps for some of its option fields too. However we show only the few fields necessary to understand each phase. We show the sequence number, the acknowledgement number, the control flags and the window size is not empty.

Simultaneous open:

A rare situation may occur when both processes issue an active open. In this case, both TCPs transmit a SYN+ACK segment to each other and one single connection is established between them.

SYN Flooding Attack:

The connection establishment procedure in TCP is susceptible to serious security problem called SYN flooding attack. This happens when a malicious attacker sends a large number of SYN segments to a server pretending that each of them is coming from a different client faking the source IP address in the datagram’s. The server assumes that the clients are issuing an active open, allocates the necessary resources, such as creating TCB tables and setting timers. The TCP server then sends the SYN+ACK segments to the fake clients, which are lost. During this time, however, a lot of resources are occupied without being used. If, during this short period of time, the number of SYN segments is large, the server eventually runs out of resources and may crash.

Data transfer:

After connection is established, bidirectional data transfer can take place. The client and server can send data and acknowledgements in both directions. The client sends 2000 bytes of data in two segments. The server then sends 2000 byes in one segment. The client sends one more segment. The first three segments carry both data and acknowledgments, but last segment carries only an acknowledgment because there is no more data to be sent. Note the values of segments and acknowledgment

© vinod vaze

Page 17: Vaze's QB on IT

QB on IT for TY BSc. (IT)

numbers. The data segments sent by the clients have the PSH flag set so that the TCP knows to deliver data to the server as soon as they are received. Most TCP implementations have the option to set or not set this flag.

Pushing data:

There are occasions in which application program has no need for flexibility. Consider an application program that communicates interactively with another application program on the other end. The application program on one site wants to send a keystroke to the application at the other site and receive an immediate response. Delayed transmission and delayed delivery of other data may not be acceptable by the application program.

TCP can handle such a situation. The application program at the sending site can request a push operation. This means that the sending TCP must not wait for the windows to be filled. It must create a segment and send it immediately. The sending TCP must also send the push bit to let the receiving TCP know that the segment includes data that must be delivered to the receiving application program as soon as possible and not to wait for more data to come.

Connection Termination:

Any of the two parties involved in exchanging data (client or server) can close the connection, although it is usually initiated by the client. Most implementation today allows two options for connection termination: three-way handshake and four-way handshake with a half-close option.

Three-Way Handshaking:

Most implementation today allow three-way handshaking for connection termination 4. In a normal situation, the client TCP, after receiving a close command from the client process, sends the first segment, a FIN segment in which the FIN flag is set. Note that a FIN segment can include the last chunk of the data sent by the client or it can be just a control segment. If it is only a control segment, it consumes only one sequence number.5. The server TCP after receiving the FIN segment informs its process of the situation and sends the second segment, a FIN+ACK segment, to confirm the receipt of the FIN segment from the client and at the same time to announce the closing of the connection in the other direction. This segment can also contain the last chunk of data from the server. If it does not carry data, it consumes only one sequence number.

© vinod vaze

Page 18: Vaze's QB on IT

QB on IT for TY BSc. (IT)

6. The client TCP sends the last segment, an ACK to confirm the receipt of the FIN segment from the TCP server. This segment contains the acknowledgement number, which is one plus the sequence number received in the FIN segment from the server. This segment cannot carry data and consumes no sequence numbers.

Half-Close:

In TCP, one end can stop sending data while still receiving data. This is called a half-close. Although either end can issue a half-close, it is normally initiated by the client. It can occur when the server needs all the data before processing can begin. A good example is sorting. When the client sends all the data to the server to be sorted, the server needs to receive all the data before sorting can start. This means the client, after sending all data, can close the connection in the outbound direction. However, the inbound direction must remain open to receive the sorted data. The server, after receiving the data still needs time for sorting; its outbound direction must remain open.

The client half-closes the connection by sending a FIN segments. The server accepts the half-close by sending the ACK segment. The data transfer from the client to the server stops. The server, however, can still send data. When the server has sent all of the process data, it sends a FIN segment, which is acknowledged by an ACK from the client. After half closing the connection, data can travel from the server to the client and acknowledgements can travel from the client to the server. The client cannot send more data to the server. Note the sequence numbers we have used. The second segment (ACK) consumes no sequence numbers. Although the client has received sequence number Y-1 and is expecting Y, the server sequence number is still Y-1. When the connection finally closes, the sequence number of the last ACK segment is still X, because no sequence numbers are consumed during data transfer in that direction.

011 Draw the IP packet format and explain each of its fields. Which fields of the IP header change from router to router?

Ans:

Packets in the IP layer are called datagrams. A datagram is variable – length packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and contains information essential to routing and delivery. It is customary in TCP/IP to show the header in 4 bytes sections. A brief description of ach field is in order.

© vinod vaze

Page 19: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Version (VER):

These 4 bits defines the version of IP protocol. Currently the version is 4. However, version 6 may totally replace version 4 in the future. This field tells the IP software running in the processing machine that the datagram has the format of version 4. All fields may be interpreted as specified in the 4th version of the protocol. If the machine is using some other version of IP datagram is discarded rather than interpreted incorrectly.

Header length (HLEN):

This 4-bit field defines the total length of the datagram of header in 4 byte word. This field is needed because the length of the header is variable. When there are no options, the header length is 20 bytes, and the value of the field is 5. When the option is field at its maximum size, the value of this field is 15.

Differentiated services (DS):

IETF has changed the interpretation and name of this bit field. This field, previously called service type, is now called differentiated services.

Total length:

This is 16-bit field that defines the total length of IP datagram in bytes. To

© vinod vaze

Page 20: Vaze's QB on IT

QB on IT for TY BSc. (IT)

find the length of data coming from the upper layer, subtract the header length from the total length. The header length can be founded by multiplying the value in the HLEN field by 4. The total length field defines the total length of the datagram including the header.

012 Explain the three way handshake method TCP connection Establishment

Ans:

Three-Way Handshaking:

Most implementation today allow three-way handshaking for connection termination

In a normal situation, the client TCP, after receiving a close command from the client process, sends the first segment, a FIN segment in which the FIN flag is set. Note that a FIN segment can include the last chunk of the data sent by the client or it can be just a control segment. If it is only a control segment, it consumes only one sequence number.

The server TCP after receiving the FIN segment informs its process of the situation and sends the second segment, a FIN+ACK segment, to confirm the receipt of the FIN segment from the client and at the same time to announce the closing of the connection in the other direction. This segment can also contain the last chunk of data from the server. If it does not carry data, it consumes only one sequence number.

© vinod vaze

Page 21: Vaze's QB on IT

QB on IT for TY BSc. (IT)

The client TCP sends the last segment, an ACK to confirm the receipt of the FIN segment from the TCP server. This segment contains the acknowledgement number, which is one plus the sequence number received in the FIN segment from the server. This segment cannot carry data and consumes no sequence numbers.

013 What do you understand by 4-way handshaking in TCP? Explain

Ans:

Half-Close:

In TCP, one end can stop sending data while still receiving data. This is called a half-close. Although either end can issue a half-close, it is normally initiated by the client. It can occur when the server needs all the data before processing can begin. A good example is sorting. When the client sends all the data to the server to be sorted, the server needs to receive all the data before sorting can start. This means the client, after sending all data, can close the connection in the outbound direction. However, the inbound direction must remain open to receive the sorted data. The server, after receiving the data still needs time for sorting; its outbound direction must remain open.

The client half-closes the connection by sending a FIN segment. The server accepts the half-close by sending the ACK segment. The data transfer from the client to the server stops. The server, however, can still send data. When the server has sent all of the process data, it sends a FIN segment, which is acknowledged by an ACK from the client.

After half closing the connection, data can travel from the server to the client and acknowledgements can travel from the client to the server. The client cannot send more data to the server. Note the sequence numbers we have used. The second segment (ACK) consumes no sequence numbers. Although the client has received sequence number Y-1 and is expecting Y, the server sequence number is still Y-1. When the connection finally closes, the sequence number of the last ACK segment is still X, because no sequence numbers are consumed during data transfer in that direction.

The diagram next page shows the details.:

© vinod vaze

Page 22: Vaze's QB on IT

QB on IT for TY BSc. (IT)

014 Explain in detail the Internet protocol datagram. A datagram is carrying 1024 bytes of data. If there is no option information, what is the value of the header length field and total length field?

Ans:

Packets in the IP layer are called datagram’s. A datagram is variable – length packet consisting of two parts: header and data. The header is 20 to 60 bytes in length and contains information essential to routing and delivery. It is customary in TCP/IP to show the header in 4 bytes sections.

© vinod vaze

Page 23: Vaze's QB on IT

QB on IT for TY BSc. (IT)

A brief description of each field is in order.

Version (VER):

These 4 bits defines the version of IP protocol. Currently the version is 4. However, version 6 may totally replace version 4 in the future. This field tells the IP software running in the processing machine that the datagram has the format of version 4. All fields may be interpreted as specified in the 4th version of the protocol. If the machine is using some other version of IP datagram is discarded rather than interpreted incorrectly.

Header length (HLEN):

This 4-bit field defines the total length of the datagram of header in 4-byte word. This field is needed because the length of the header is variable. When there are no options, the header length is 20 bytes, and the value of the field is 5. When the option is field at its maximum size, the value of this field is 15.

Differentiated services (DS):

IETF has changed the interpretation and name of this bit field. This field, previously called service type, is now called differentiated services.

Total length:

This is 16-bit field that defines the total length of IP datagram in bytes. To find the length of data coming from the upper layer, subtract the header length from the total length. The header length can be founded by multiplying the value in the HLEN field by 4. The total length field defines the total length of the datagram including the header.

015 How does transmission control protocol avoid transmission? Explain in detail.

Ans:

If we start with the slow start algorithm, the size of congestion window increases exponentially. To avoid congestion before it happens, one must slow down this exponential growth. TCP defines another algorithm called congestion avoidance, which increases additively instead of exponentially. When the size of the congestion window reaches the slow start threshold, the whole window of segments is acknowledged, the size of the congestion window is increased by one. To show the idea, we apply this algorithm, to the same scenario as slow start although as we will see that

© vinod vaze

Page 24: Vaze's QB on IT

QB on IT for TY BSc. (IT)

the congestion avoidance usually starts when the size of the window is much greater than one. After the sender has received acknowledgements for a complete window size of segments, the size of the window is increased by one segment.

016 Explain in detail the Internal Protocol datagram. A datagram is carrying 1024 bytes of data. If there is no option information, what is the value of the header length field and the total length field? (October 2005)Answer:

An IP packet consists of a header section and a data section.

Header

The header consists of 13 fields, of which only 12 are required. The 13 th

field is optional (red background in table) and aptly named: options. The fields in the header are packed with the most significant byte first , and for the diagram and discussion, the most significant bits are considered to come first. The most significant bit is numbered 0, so the version field is actually found in the 4 most significant bits of the first byte, for example.

Version

The first header field in an IP packet is the 4-bit version field. For IPv4, this has a value of 4 (hence the name IPv4).

Internet Header Length (IHL)

The second field is a 4-bit Internet Header Length (IHL) telling the number of 32-bit words in the header. Since an IPv4 header may contain a variable number of options, this field specifies the size of the header (this also coincides with the offset to the data). The minimum value for this field is 5 (rfc791), which is a length of 5×32 = 160 bits. Being a 4-bit field the maximum length is 15 words or 480 bits.

Type of Service (TOS)

In RFC 791, the following 8 bits were allocated to a Type of Service (TOS) field:

Bit 0-2: precedence Bit 3: 0 = Normal Delay, 1 = Low Delay Bit 4: 0 = Normal Throughput, 1 = High Throughput Bit 5: 0 = Normal Reliability, 1 = High Reliability

© vinod vaze

Page 25: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Bits 6-7: Reserved for future use

This field is now used for DiffServ and ECN. The original intention was for a sending host to specify a preference for how the datagram would be handled as it made its way through an internetwork. For instance, one host could set its IPv4 datagrams' TOS field value to prefer low delay, while another might prefer high reliability. In practice, the TOS field has not been widely implemented. However, a great deal of experimental, research and deployment work has focused on how to make use of these eight bits. These bits have been redefined, most recently through DiffServ working group in the IETF and the Explicit Congestion Notification codepoints. New technologies are emerging that require real-time data streaming and therefore will make use of the TOS field. An example is Voice over IP (VoIP) that is used for interactive data voice exchange.

Total Length

This 16-bit field defines the entire datagram size, including header and data, in bytes. The minimum-length datagram is 20 bytes (20 bytes header + 0 bytes data) and the maximum is 65,535 — the maximum value of a 16-bit word. The minimum size datagram that any host is required to be able to handle is 576 bytes, but most modern hosts handle much larger packets. Sometimes subnetworks impose further restrictions on the size, in which case datagrams must be fragmented. Fragmentation is handled in either the host or packet switch in IPv4 (see Fragmentation and reassembly).

Identification

This field is an identification field and is primarily used for uniquely identifying fragments of an original IP datagram. Some experimental work has suggested using the ID field for other purposes, such as for adding packet-tracing information to datagrams in order to help trace back datagrams with spoofed source addresses.

Flags

A 3-bit field follows and is used to control or identify fragments. They are (in order, from high order to low order):

Reserved; must be zero. As an April Fools joke, proposed for use in RFC 3514 as the "Evil bit".

Don't Fragment (DF)

© vinod vaze

Page 26: Vaze's QB on IT

QB on IT for TY BSc. (IT)

More Fragments (MF)

If the DF flag is set and fragmentation is required to route the packet then the packet will be dropped. This can be used when sending packets to a host that does not have sufficient resources to handle fragmentation.When a packet is fragmented all fragments have the MF flag set except the last fragment, which does not have the MF flag set. The MF flag is also not set on packets that are not fragmented — clearly an unfragmented packet can be considered the last fragment.

Fragment Offset

The fragment offset field, measured in units of 8-byte blocks, is 13-bits long and specifies the offset of a particular fragment relative to the beginning of the original unfragmented IP datagram. The first fragment has an offset of 0. This allows a maximum offset of

65,528 ( ), which would exceed the maximum IP packet length of 65,535 with the header length included.

Time To Live (TTL)

An 8-bit time to live (TTL) field helps prevent datagrams from persisting (e.g. going in circles) on an internetwork. Historically the TTL field limited a datagram's lifetime in seconds, but has come to be a hop count field. Each packet switch (or router) that a datagram crosses decrements the TTL field by one. When the TTL field hits zero, the packet is no longer forwarded by a packet switch and is discarded. Typically, an ICMP message (specifically the time exceeded) is sent back to the sender that it has been discarded. The reception of these ICMP messages is at the heart of how traceroute works.

Protocol

This field defines the protocol used in the data portion of the IP datagram. The Internet Assigned Numbers Authority maintains a list of Protocol numbers and were originally defined in RFC 790. Common protocols and their decimal values are shown below.

Header Checksum

The 16-bit checksum field is used for error-checking of the header. At each hop, the checksum of the header must be compared to the value of this field. If a header checksum is found to be mismatched,

© vinod vaze

Page 27: Vaze's QB on IT

QB on IT for TY BSc. (IT)

then the packet is discarded. Note that errors in the data field are up to the encapsulated protocol to handle — indeed, both UDP and TCP have checksum fields.

Since the TTL field is decremented on each hop and fragmentation is possible at each hop then at each hop the checksum will have to be recomputed. The method used to compute the checksum is defined within RFC 791:

The checksum field is the 16-bit one's complement of the one's complement sum of all 16-bit words in the header. For purposes of computing the checksum, the value of the checksum field is zero.In other words, all 16-bit words are summed together using one's complement (with the checksum field set to zero). The sum is then one's complemented and this final value is inserted as the checksum field.

Source address

An IP address is a group of 4 8-bit octets for a total of 32 bits. The value for this field is determined by taking the binary value of each octet and concatenating them together to make a single 32-bit value.

For example, the address 10.9.8.7 (00001010. 00001001. 00001000. 00000111 in binary) would be 00001010000010010000100000000111.

This address is the address of the sender of the packet. Note that this address may not be the "true" sender of the packet due to network address translation. Instead, the source address will be translated by the NATing machine to its own address. Thus, reply packets sent by the receiver are routed to the NATing machine, which translates the destination address to the original sender's address.

Destination address

Identical to the source address field but indicates the receiver of the packet.

Options

Additional header fields may follow the destination address field, but these are not often used. Note that the value in the IHL field must include enough extra 32-bit words to hold all the options (plus

© vinod vaze

Page 28: Vaze's QB on IT

QB on IT for TY BSc. (IT)

any padding needed to ensure that the header contains an integral number of 32-bit words). The list of options may be terminated with an EOL (End of Options List) option; this is only necessary if the end of the options would not otherwise coincide with the end of the header. The possible options that can be put in the header are as follows:

Field Size (bits)

Description

Copied 1 Set to 1 if the options need to be copied into all fragments of a fragmented packet.

Option Class

2 A general options category. 0 is for "control" options, and 2 is for "and measurement". 1, and 3 are reserved.

The header of the IP datagram is made up of 2 parts. : A fixed part (20 bytes long) and a variable part that comprises the options that can be a maximum of 40 bytes. Total Length field = Header Length + data Since there is no option information, the size of the header= 20 bytes.Therefore value of the total length field = 20 + 1024 bytes = 1044 bytes

017 The following is dump of a TCP header in hexadecimal format.05320017 00000001 0000 0000 500207FF 00000000 (20 bytes)

i) What is the source port number?ii) What is the destination port number?iii) What is the sequence number?iv) What is the acknowledgement number?v) What is the length of the header?vi) What is the type of the segment?vii) What is the window size?

Ans:

i) The source port number is: 1330ii) The destination port number is: 23iii) The sequence number is: 1iv) The acknowledgement number is: 0 v) The length of the header is: 5 x 4 = 20 bytesvi) The type of segment is: The synchronize bit is set. Hence it is

synchronize segment.vii) The size of window is: 511

© vinod vaze

Page 29: Vaze's QB on IT

QB on IT for TY BSc. (IT)

018 An IP datagram has arrived with the following information in the header (in hexadecimal)

4500 00 54 00 03 00 00 20 06 00 00 7C 4E 03 02 B4 0E 0F 02

Ans.

Field Number of bits

Given Value in hexadecimal

Value in binary digits

Version 4 4 0100Header Length 4 5 0101Differentiated Service

8 00 00000000

Total length 16 0054 00000000 01010100Identification 16 0003 00000000 00000011

Flags 3 0 000Fragmentation Offset

13 00 00000000

Time to Live 8 20 0010 0000Protocol 8 06 0000 0110

© vinod vaze

Page 30: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Header Checksum

16 0000 00000000 00000000

S. No Question Answer

1. Classify the above header Version IPv4

2. Are there any options? No

3. Is the packet fragmented? Yes: “R00” Last fragment

4 What is the size of the data? In 4-byte word = (54)16 – (5)16

= (4F)16

= 79and in bytes

=79 * 4 =316 bytes

5 Is a checksum used? No

6 How many more routers can a packet travel to?

(20)16

= (32)10

= 327 What is the identification

number of the packet?3

8 What is the type of the service?

Protocol is 06 = TCP

019 Transmission control protocol is a connection-oriented protocol. How does it establish the connection? Explain in detail the process of connection establishment. (November 2004)

Ans.

TCP is a connection-oriented protocol. It establishes a virtual path between the source and destination. All the segments belonging to a message are then sent over this virtual path. Using a single virtual pathway for the entire message facilitates the acknowledgment process as well as retransmission of damaged or lost frames. In TCP, connection-oriented transmission requires two procedures:

© vinod vaze

Page 31: Vaze's QB on IT

QB on IT for TY BSc. (IT)

1) Connection Establishment and 2) Connection Termination.

Connection Establishment

TCP transmits data in full-duplex mode. When two TCPs in two machines are connected, they are able to send segments to each other simultaneously. This implies that each party must initialize communication and get approval from the other party before any data transfer. Four steps are needed to establish the connection, as discussed before. However, the second and third steps can be combined to create a three-step connection, called a three-way handshake, as shown in Figure.

The steps of the process are as follows:

1. The client sends the first segment, a SYN segment. The segment includes the source and destination port numbers. The destination port number clearly defines the server to which the client wants to be connected. The segment also contains the client initialization sequence number (ISN) used for numbering the bytes of data sent from the client to the server.

© vinod vaze

Page 32: Vaze's QB on IT

QB on IT for TY BSc. (IT)

2. The server sends the second segment; a SYN and an ACK segment. This segment has a dual purpose. First, it acknowledges the receipt of the first segment, using the ACK flag and acknowledgment number field. Note that the acknowledgment number is the client initialization sequence number plus 1 because no user data have been sent in segment 1. The server must also define the client window size. Second, the segment is used as the initialization segment for the server. It contains the initialization sequence number used to number the bytes sent from the server to the client.

3. The client sends the third segment. This is just an ACK segment. It acknowledges the receipt of the second segment, using the ACK flag and acknowledgment number field. Note that the acknowledgment number is the server initialization sequence number plus 1 because no user data have been sent in segment 2. The client must also define the server window size. Data can be sent with the third packet.

© vinod vaze

Page 33: Vaze's QB on IT

QB on IT for TY BSc. (IT)

020 How TCP provides reliability using error control? What is the Maximum size of TCP header? What is the minimum size of TCP header? (May 2005)

Ans.

TCP is a reliable transport layer protocol. This means that an application program that delivers a stream of data to TCP relies on TCP to deliver the entire stream to the application program on the other end in order, without error and without any part lost or duplicated.

TCP provides reliability using error control. Error control includes mechanisms for detecting corrupted segments lost segments, out-of-order segments and duplicated segments. Error control also includes a mechanism for correcting errors after they are detected.

Error Detection and Error Correction:

Error Detection in TCP is achieved through the use of three simple tools: checksum, acknowledgment and time-out. Each segment includes the checksum field, which is used to check for a corrupted segment. If the segment is not acknowledged before the timeout, it is considered to be either corrupted or lost.

The error correction mechanism used by TCP is also very simple. The source TCP starts one time-out counter for each segment sent. Each counter is checked periodically. When a counter matures, the corresponding segment is considered to be either corrupted or lost and the segment will be retransmitted.

The segment consists of a 20-byte to 60-byte header, followed by data from the application program. The header is 20-byte if there are no options and up to 60-bytes if it contains options.

021 Draw the IP packet format and explain each of its field. Which fields of the IP header change from router to router?(May 2005)

Ans:

Figure: The IP header layout

© vinod vaze

Page 34: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Version Number

This is a 4-bit field that contains the IP version number the protocol software is using. The version number is required so that receiving IP software knows how to decode the rest of the header, which changes with each new release of the IP standards. The most widely used version is 4, although several systems are now testing version 6 (called IPng). The Internet and most LANs do not support IP version 6 at present. Part of the protocol definition stipulates that the receiving software must first check the version number of incoming datagram before proceeding to analyze the rest of the header and encapsulated data. If the software cannot handle the version used to build the datagram, the receiving machine's IP layer rejects the datagram and ignores the contents completely.

Header Length

This 4bit field reflects the total length of the IP header built by the sending machine; it is specified in 32bit words. The shortest header is five words (20 bytes), but the use of optional fields can increase the header size to its maximum of six words (24 bytes). To properly decode the header, IP must know when the header ends and the data begins, which is why this field is included. (There is no start of data marker to show where the data in the datagram begins. Instead, the header length is used to compute an offset from the start of the IP header to give the start of the data block.)

Type of Service

© vinod vaze

Page 35: Vaze's QB on IT

QB on IT for TY BSc. (IT)

The 8bit (1 byte) Service Type field instructs IP how to process the datagram properly. The field's 8 bits are read and assigned as shown in Figure 3.2, which shows the layout of the Service Type field inside the larger IP header shown in Figure 3.1. The first 3 bits indicate the datagram's precedence, with a value from 0 (normal) through 7 (network control). The higher the number, the more important the datagram and, in theory at least, the faster the datagram should be routed to its destination. In practice, though, most implementations of TCP/IP and practically all hardware that uses TCP/IP ignores this field, treating all datagram with the same priority.

Figure: The 8bit Service Type field layout

The next three bits are 1bit flags that control the delay, throughput, and reliability of the datagram. If the bit is set to 0, the setting is normal. A bit set to 1 implies low delay, high throughput, and high reliability for the respective flags. The last two bits of the field are not used. Most of these bits are ignored by current IP implementations, and all datagram are treated with the same delay, throughput, and reliability settings. For most purposes, the values of all the bits in the Service Type field are set to 0 because differences in precedence, delay, throughput, and reliability between machines are virtually nonexistent unless a special network has been established. Although these

Flags would be useful in establishing the best routing method for a datagram, no currently available UNIX based IP system bothers to evaluate the bits in these fields. (Although it is conceivable that the code could be modified for high security or high reliability networks.)

Datagram Length (or Packet Length)

This field gives the total length of the datagram, including the header, in bytes. The length of the data area itself can be computed by subtracting the header length from this value. The size of the total datagram length field is 16 bits, hence the 65,535 bytes maximum length of a datagram (including the header). This field is used to determine the length value to be passed to the transport protocol to set the total frame length.

Identification

This field holds a number that is a unique identifier created by the sending

© vinod vaze

Page 36: Vaze's QB on IT

QB on IT for TY BSc. (IT)

node.This number is required when reassembling fragmented messages, ensuring that the fragments of one message are not intermixed with others. Each chunk of data received by the IP layer from a higher protocol layer is assigned one of these identification numbers when the data arrives. If a datagram is fragmented, each fragment has the same identification number.

Flags

The Flags field is a 3bit field, the first bit of which is left unused (it is ignored by the protocol and usually has no value written to it). The remaining two bits are dedicated to flags called DF (Don't Fragment) and MF (More Fragments), which control the handling of the datagram when fragmentation is desirable. If the DF flag is set to 1, the datagram cannot be fragmented under any circumstances. If the current IP layer software cannot send the datagram on to another machine without fragmenting it, and this bit is set to 1, the datagram is discarded and an error message is sent back to the sending device. If the MF flag is set to 1, the current datagram is followed by more packets (sometimes called sub packets), which must be reassembled to recreate the full message. The last fragment that is sent as part of a larger message has its MF flag set to 0 (off) so that the receiving device knows when to stop waiting for datagram. Because the order of the fragments' arrival might not correspond to the order in which they were sent, the MF flag is used in conjunction with the Fragment Offset field (the next field in the IP header) to indicate to the receiving machine the full extent of the message.

Fragment Offset

If the MF (More Fragments) flag bit is set to 1 (indicating fragmentation of a larger datagram), the fragment offset contains the position in the complete message of the sub message contained within the current datagram. This enables IP to reassemble fragmented packets in the proper order. Offsets are always given relative to the beginning of the message. This is a 13bit field, so offsets are calculated in units of 8 bytes, corresponding to the maximum packet length of 65,535 bytes. Using the identification number to indicate which message a receiving datagram belongs to, the IP layer on a receiving machine can then use the fragment offset to reassemble the entire message.

Time to Live (TTL)

This field gives the amount of time in seconds that a datagram can remain on theNetwork before it is discarded. This is set by the sending node when the

© vinod vaze

Page 37: Vaze's QB on IT

QB on IT for TY BSc. (IT)

datagram is assembled. Usually the TTL field is set to 15 or 30 seconds. The TCP/IP standards stipulate that the TTL field must be decreased by at least one second for each node that processes the packet, even if the processing time is less than one second. Also, when a datagram is received by a gateway, the arrival time is tagged so that if the datagram must wait to be processed, that time counts against its TTL. Hence, if a gateway is particularly overloaded and can't get to the datagram in short order, the TTL timer can expire while waiting processing, and the datagram is abandoned. If the TTL field reaches 0, the datagram must be discarded by the current node, but a message is sent back to the sending machine when the packet is dropped. The sending machine can then resend the datagram. The rules governing the TTL field are designed to prevent IP packets from endlessly circulating through networks.

Transport Protocol

This field holds the identification number of the transport protocol to which the packet has been handed. The numbers are defined by the Network Information Center (NIC), which governs the Internet. There are currently about 50 protocols defined and assigned a transport protocol number. The two most important protocols are ICMP (detailed in the section titled "Internet Control Message Protocol (ICMP)" later today), which is number 1, and TCP, which is number 6. The full list of numbers is not necessary here because most of the protocols are never encountered by users. (If you really want this information, it’s in several RFCs mentioned in the appendixes.)

Header Checksum

The number in this field of the IP header is a checksum for the protocol headerField (but not the data fields) to enable faster processing. Because the Time to Live (TTL) field is decremented at each node, the checksum also changes with every machine the datagram passes through. The checksum algorithm takes the ones complement of the 16bit sum of all 16bit words. This is a fast, efficient algorithm, but it misses some unusual corruption circumstances such as the loss of an entire 16bit word that contains only 0s. However, because the data checksums used by both TCP and UDP cover the entire packet, these types of errors usually can be caught as the frame is assembled for the network transport.

Sending Address and Destination Address

These fields contain the 32bitIP addresses of the sending and destination devices. These fields are established when the datagram is created and are not altered during the routing.

© vinod vaze

Page 38: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Options

The Options field is optional, composed of several codes of variable length. If more than one option is used in the datagram, the options appear consecutively in the IP header. All the options are controlled by a byte that is usually divided into three fields: a 1bit copy flag, a 2bit option class, and a 5bit option number. The copy flag is used to stipulate how the option is handled when fragmentation is necessary in a gateway. When the bit is set to 0, the option should be copied to the first datagram but not subsequent ones. If the bit is set to 1, the option is copied to all the datagram. The option class and option number indicate the type of option and its particular value. At present, there are only two option classes set. (With only 2 bits to work with in the field, a maximum of four options could be set.) When the value is 0, the option applies to datagram or network control. A value of 2 means the option is for debugging or administration purposes. Values of 1 and 3 are unused. Currently supported values for the option class and number are given in Table 3.1. Of most interest to you are options that enable the routing and timestamps to be recorded. These are used to provide a record of a datagram's passage across the internet work, which can be useful for diagnostic purposes. Both these options add information to a list contained within the datagram. (The timestamp has an interesting format: it is expressed in milliseconds since midnight, Universal Time. Unfortunately, because most systems have widely differing time settings—even when corrected to Universal Time—the timestamps should be treated with more than a little suspicion.) There are two kinds of routing indicated within the Options field: loose and strict. Loose routing provides a series of IP addresses that the machine must pass through, but it enables any route to be used to get to each of these addresses (usually gateways). Strict routing enables no deviations from the specified route. If the route can't be followed, the datagram is abandoned. Strict routing is frequently used for testing routes but rarely for transmission of user datagram because of the higher chances of the datagram being lost or abandoned.

Padding

The content of the padding area depends on the options selected. The padding isUsually used to ensure that the datagram header is a round number of bytes.

A Datagram's Life

To understand how IP and other TCP/IP layers work to package and send a datagram from one machine to another, I take a simplified look at a

© vinod vaze

Page 39: Vaze's QB on IT

QB on IT for TY BSc. (IT)

typical datagram's passage. When an application must send a datagram out on the network, it performs a few simple steps. First, it constructs the IP datagram within the legal lengths stipulated by the local IP implementation. The checksum is calculated for the data, and then the IP header is constructed. Next, the first hop (machine) of the route to the destination must be determined to route the datagram to the destination machine directly over the local network or to a gateway if the internet work is used. If routing is important, this information is added to the header using an option. Finally, the datagram is passed to the network for its manipulation of the datagram. As a datagram passes along the internetwork, each gateway performs a series of tests. After the network layer has stripped off its own header, the gateway IP layer calculates the checksum and verifies the integrity of the datagram. If the checksums don't match, the datagram is discarded and an error message is returned to the sending device.

Next, the TTL field is decremented and checked. If the datagram has expired, it is discarded and an error message is sent back to the sending machine. After determining the next hop of the route, either by analysis of the target address or from a specified routing instruction within the Options field of the IP header, the datagram is rebuilt with the new TTL value and new checksum.

If fragmentation is necessary because of an increase in the datagram's length or a limitation in the software, the datagram is divided and new datagram with the correct Header information is assembled. If a routing or timestamp is required, it is added as well. Finally, the datagram is passed back to the network layer. When the datagram is finally received at the destination device, the system performs a checksum calculation and—assuming the two sums match—checks to see if there are other fragments.

If more datagram are required to reassemble the entire message, the system waits, meanwhile running a timer to ensure that the datagram arrive within a reasonable time. If all the parts of the larger message have arrived but the device can't reassemble them before the timer reaches 0, the datagram is discarded and an error message is returned to the sender.

Finally, the IP header is stripped off, the original message is reconstructed if it was fragmented, and the message is passed up the layers to the upper layer application. If a reply was required, it is then generated and sent back to the sending device. When extra information is added to the datagram for routing or timestamp recording, the length of the datagram can increase. Handling all these conditions is part of IP's forte, for which practically every problem has a resolution system.

© vinod vaze

Page 40: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Following fields of the IP header may change from router to router. Total length Flags Fragmentation offset Time to live Header checksum

022 The connection establishment is called as three-way handshaking. In this procedure, an application program called the client, wants to make a connection with another application program, called the server, using TCP as the transport layer protocol the three-way handshaking procedure starts with the server. The server program tells its TCP that it is ready to accept a connection. This is called a request for a passive open. Although the server TCP is ready to accept any connection from any machine in the world it can not make connection it self. The client program makes a request for an active open. A client wishes to connect to a server tells its TCP that it needs to be connected to a particular server

The steps of the processes as follows:

1. The client sends the first segment, a SYN segment. The segment included the source and destination port numbers. The destination port number clearly defines the server to which the clients want to be connected. The segment also contains the client initialization sequence number (ISN) used for numbering the bytes of data sent from the client to the server. If the client wants to define the MSS that it can receive from the server, it can add the corresponding option here. Also, if the client needs a large window, it defines the window scale factor here using the appropriate option. This segment defines the wish of the client to make a connection with certain parameters.

2. The server sends the second segment, a SYN and AC segment. This segment hasa dual purpose. First, it acknowledges the receipt of the first segment using the ACK flag and acknowledgement number field. The acknowledgement number is the client initialization sequence number plus one.

The server must also define the client window size second, the segment is used to number the bytes sent from the server to client. It also contains the window scale factor option (if needed) to be used by the server and the MSS defined by the server.

3. The client sends the third segment. This is just an ACK segment. It

8

© vinod vaze

Page 41: Vaze's QB on IT

QB on IT for TY BSc. (IT)

acknowledgesThe receipts of the second segment sign the ACK flag and acknowledgement number field. The acknowledgement number is the server initialization sequence number plus one. The client must also define the server window size. A rare situation may occur when both processes issue an active open. In this case, both TCP’s transmit a SYN+ACK segment to each other and one single connection is established between them.

Figure: Three Way handshake

© vinod vaze

Page 42: Vaze's QB on IT

QB on IT for TY BSc. (IT)

023 What do you understand by Four-way handshaking in TCP? Explain

Ans:

Four Way Handshake:The connection termination called as four-way handshake. In this procedure an Application program, usually the client wants to terminate a connection.

The procedure starts with the client. The client program tells its TCP that it has finished Sending data and wishes to terminate the connection. This is a request for an active close.After receiving the request for an active close, the client TCP closes communication in the client server direction. However communication is the other direction is still open. When the server program has finished sending data in the server client direction, it can request from its TCP to close the connection in the server client direction. This isNormally a positive close.

The four steps are:

o The client TCP sends the first segment, a FIN segment.

o The server TCP sends the second segment, an ACK segment to confirm the Receipt of the FIN segment from the client. In this segment, it uses the Acknowledgement number, which is one plus the sequence number received in the FIN segment.

o The server TCP can continue sending data in the server client direction. When it does not have any more data to send, it sends the third segment. This segment is a FIN segment.

o The client TCP sends the fourth segment, an ACK segment, to confirm the receipt of the FIN segment contains the acknowledgement number, which is one plus the sequence number is received in the FIN segment from the server.

Figure: Four Way Handshake

8

© vinod vaze

Page 43: Vaze's QB on IT

QB on IT for TY BSc. (IT)

024 Draw the TCP state transition diagram. Explain the states, which the TCP client can attain?

Ans:

A connection progresses through a series of states during its lifetime (listed below). CLOSED is fictional because it represents the state when there is no TCB, and therefore, no connection. Briefly the meanings of the states are:

8

© vinod vaze

Page 44: Vaze's QB on IT

QB on IT for TY BSc. (IT)

· LISTEN represents waiting for a connection request from any remote

TCP and Port.

SYNSENT represents waiting for a matching connection request after having sent a connection request.

SYNRECEIVED represents waiting for a confirming connection request

ACKNOWLEDGMENT after having both received and sent a connection request.

© vinod vaze

Page 45: Vaze's QB on IT

QB on IT for TY BSc. (IT)

ESTABLISHED represents an open connection, data received can be delivered to the user. The normal state for the data transfer phase of the connection.

FINWAIT1 represents waiting for a connection termination request from the Remote TCP or an acknowledgment of the connection termination request previously sent.

FINWAIT2 represents waiting for a connection termination request from the Remote TCP.

CLOSEWAIT represents waiting for a connection termination request from the Local user.

CLOSING represents waiting for a connection termination request Acknowledgment from the remote TCP.

LASTACK represents waiting for an acknowledgment of the connection Termination request previously sent to the remote TCP (which includes an Acknowledgment of its connection termination request).

TIMEWAIT represents waiting for enough time to pass to be sure the remote TCP received the acknowledgment of its connection termination request.

CLOSED represents no connection state at all.

A TCP connection progresses from one state to another in response to events. The events are the user calls, OPEN, SEND, RECEIVE, CLOSE, ABORT, and STATUS; The incoming segments, particularly those containing the SYN, ACK, RST and FIN flags; And timeouts.

© vinod vaze

Page 46: Vaze's QB on IT

QB on IT for TY BSc. (IT)

025 What is Kern’s Algorithm?

Ans:

Karn’s Algorithm:

Suppose that a segment is not acknowledged during the retransmission period and it is therefore retransmitted. When the sending TCP receives an acknowledgment for this segment, it does not know if the acknowledgment is for the original segment or for the retransmitted one.

The value of the new RTT therefore must be calculated based on the departure of the segment. However, if the original segment was lost and the acknowledgment is for the retransmitted one, the value of the current RTT must be calculated from the time the segment was retransmitted.

This is a dilemma that was solved by Karn. Karn’s solution is very simple.

Do not consider the RTT of a retransmitted segment in the calculation of the new RTT. Do not update the value of RTT until you send a segment and receive an acknowledgment without the need for retransmission.

026Nagle Algorithm is very simple, but it solves the problem. This algorithm is for the sending TCP:

1. The sending TCP sends the first piece of data it receives from the sending application program even if it is only 1 byte.

2. After sending the first segment, the sending TCP accumulates data in the output buffer and waits until either the receiving TCP sends an acknowledgment or until enough data has accumulated to fill a maximum-size segment. At this time, the sending TCP can send the segment.

3. Step 2 is repeated for the rest of transmission. Segment 3 must be sent if an acknowledgment is received for segment 2 or enough data is accumulated to fill a maximum-size segment.

Syndrome Created by the Receiver:

The receiving TCP may create a silly window syndrome if it is serving an application program that consumes data slowly, for example, 1 byte at a time. Suppose that the program consumes data 1 byte at a time. Also suppose that the input buffer of the receiving TCP is 4K. The sender

4

© vinod vaze

Page 47: Vaze's QB on IT

QB on IT for TY BSc. (IT)

sends the first 4 Kbytes of data. The receiver stores it in its buffer. Now its buffer is full. It advertises a window size, which means the sender should stop sending data. The receiving application reads the first byte of data from the input buffer of the receiving TCP. Now there is 1 byte of space in the incoming buffer. The receiving TCP announces a window size of 1-byte, which means that the sending TCP, which is eagerly waiting to send data, takes this advertisement as good news sends a segment carrying only 1-byte of data. The procedure will continue. One byte of data is consumed and a segment carrying 1 byte of data is sent. Again we have efficiency problem and a silly-window syndrome.

Two Solutions have been proposed to prevent the silly window syndrome created by an application program that consumes data slower than they arrive.

Clark’s Solution:

Clark’s solution is to send an acknowledgment as soon as the data arrives, but to announce a window size of zero until either there is enough space to accommodate a segment of maximum size or until half of the buffer is empty.

027 What happens when a router receives packets faster than it processes them? How can such a situation be avoided?

Ans:

1. When a router receives packets than it processes them then the packets will be discarded. Because the data that is received is typically buffered in memory, as the processor cannot deal with it immediately. If there is too much data arriving to be processed, the data buffer can often overflow, and all newly arriving data will be discarded.

2. Thus, there is a need for a mechanism, which can tell hosts to stop sending data segments, and to wait until the data has been properly processed. The transport layer copes with these problems by issuing a Not Ready indicator, which tells a transmitter not to send any more data, until the hosts sends a Ready indicator. After this the transmitter can send data.

© vinod vaze

Page 48: Vaze's QB on IT

QB on IT for TY BSc. (IT)

028 Transmission control protocol using error control? What is max size of TCP header? What is the minimum size of TCP header?

Ans: -

Error Control – Error control refers to the set of procedures that are used to ensure error free transmission of data over the network. It thus involves an error detection mechanism and retransmission of messages in which error were detected.

Retransmission Timer - To control a lost or discarded segment, TCP employs a retransmission timer that handles the retransmission time, the waiting time for an acknowledgement of a segment. When TCP sends a segment, it creates a retransmission timer for that particular segment.

Two situations may occur:

1) If an acknowledgement is received for this particular segment before the timer goes off, the timer is destroyed.

2) If the timer goes off before the acknowledgement arrives, the segment is retransmitted and the timer is reset.

The minimum size of TCP header is 5 words i.e. 20 bytes.

The maximum size of TCP header is 15 words i.e. 60 bytes.

029 What are the different states for transmission control protocol? What are the states, which the TCP client can attain?A TCP connection is in the FIN-WAIT-1 state.

The following events occur one after another 1. An ACK segment is received.2. A FIN segment is received. Time-out occurs.

What is the state of the connection after each event? What is action after each event?

Ans: -

States for TCP

© vinod vaze

Page 49: Vaze's QB on IT

QB on IT for TY BSc. (IT)

LISTEN SYN-SENT SYN-RECEIVED ESTABLISHED FIN-WAIT-1 FIN-WAIT-2 CLOSE-WAIT CLOSING LAST-ACK TIME-WAIT CLOSED

A TCP connection is in the FIN-WAIT-1 state. In which TCP is waiting for a connection termination request or an acknowledgment of a connection termination from the remote TCP.

1. TCP has received the ACK segment for connection termination.

2. A FIN segment is received which indicates that the sender has no more data to send. This is the equivalent of an end-of-transmission marker.

OR

1) Application sends close message

Action: Application will send FIN request to the remote machine. And then waits for remote machine to send ACK or Acknowledgment. And goes into FIN-WAIT-1 state

State: FIN-WAIT- 1 (Means that application is waiting for ACK to Be received)

2) ACK segment is received

Action: ACK is received from remote machine. As soon as ACK is Received this machine waits for remote machine to send FIN or connection termination request. And goes into FIN- WAIT-2 stateState: FIN-WAIT-2 (Sender is waiting for remote machine to get FIN request)

3) FIN segment is received

Action: as soon as FIN is received from server, client sends ACK to the server

© vinod vaze

Page 50: Vaze's QB on IT

QB on IT for TY BSc. (IT)

State: FIN-WAIT-2

4) Application Sends close message

Action: Practically after sending ACK to the server Client waits for Period of time = double the maximum Segment Size to Make sure that Server has received ACK sent beforeState: TIME-WAIT

And once the timers expires after double the MSL time connection is closed.

States of TCP:

ESTABLISHED, FIN – WAIT – 1, FIN – WAIT – 2, TIME – WAIT, CLOSED.

i) An ACK segment is received

© vinod vaze

Page 51: Vaze's QB on IT

QB on IT for TY BSc. (IT)

State of Connection: FIN – WAIT – 2

Action after event: Wait for server to finish

ii) A FIN segment is received

State of Connection: TIME – WAIT

Action after event: Send ACK, Wait for double Maximum Segment Life(MSL) Time. And the connection is closed.

030031

100 ARP (Address Resolution Protocol)

101 Draw a sketch for Cache Table:

102103104105

© vinod vaze

Page 52: Vaze's QB on IT

QB on IT for TY BSc. (IT)

200 RARP (Reverse Address Resolution Protocol)

201 With the help of a neat diagram explain the fields in Reverse Address Resolution Protocol packet. (October 2005)

RARP packet:RARP packet:

Hardware type Protocol type

Hardware address length

Protocol address length Opcode

Source hardware address:::

Source protocol address:::

Destination hardware address:::

Destination protocol address:::

Hardware type. 16 bitsHardware type. 16 bits..

Type Description

1 Ethernet.

2 Experimental Ethernet.

3 Amateur Radio AX.25.

4 Proteon ProNET Token Ring.

5 Chaos.

6 IEEE 802.

7 ARCNET.

8 Hyperchannel.

9 Lanstar.

10 Autonet Short Address.

11 LocalTalk.

12 LocalNet (IBM PCNet or SYTEK LocalNET).

13 Ultra link.

14 SMDS.

© vinod vaze

Page 53: Vaze's QB on IT

QB on IT for TY BSc. (IT)

15 Frame Relay.

16 ATM, Asynchronous Transmission Mode.

17 HDLC.

18 Fibre Channel.

19 ATM, Asynchronous Transmission Mode.

20 Serial Line.

21 ATM, Asynchronous Transmission Mode.

22 MIL-STD-188-220.

23 Metricom.

24 IEEE 1394.1995.

25 MAPOS.

26 Twinaxial.

27 EUI-64.

28 HIPARP.

Protocol type. 16 bits.Protocol type. 16 bits.

Protocol Description

0x800 IP.

Hardware address length. 8 bits.Length of the hardware address in bytes.

Protocol address length. 8 bits.Length of the protocol address in bytes.

Opcode. 8 bits.Opcode. 8 bits.

Opcode Description References

3Request Reverse.

RFC 903

4Reply Reverse.

RFC 903

Source hardware address. Variable length.

Source protocol address. Variable length.

© vinod vaze

Page 54: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Destination hardware address. Variable length.

Destination protocol address. Variable length.

202 Write a shot note on RARP (November 2004)

Ans: -

RARP - It is used by a host to discover its IP address

The machine can get the physical address by reading the NIC, which is unique locally.

It can then use the physical address to get the logical address using the RARP protocol.

A RARP request is created and broadcast on the local network.

Another machine on the local network that knows all the IP addresses will respond with RARP reply.

The requesting machine must be running a RARP client program, the responding machine must be running a RARP server program

Packet Format – Same as ARP Packet format

0 8 16 24 31

Hardware Address Type Protocol Type

Header Len Paddr Len Operation

Sender h/w addr (last 2 octals) Sender Paddr (first 2 octals)

Sender Paddr (last 2 octals) Target h/w addr (first 2 octals)

Target Haddr (last 4 octals)

Target Paddr (all 4 octals)

4

© vinod vaze

Page 55: Vaze's QB on IT

QB on IT for TY BSc. (IT)

203 The RARP request packets are broadcast; RARP reply packets are unicast, Explain. (May 2005)

Ans: -

A machine that has its physical address and needs to find its IP address sends a RARP request to all systems on the network.

This packet is received by every host/router on a physical network, but only the RARP server on the right will answer it.

The server sends back the RARP reply packet that includes the IP address of the requestor.

4

204205206207208209210

300 RIP (Routing Information Protocol)

301

The algorithm as presented up to this point will always allow a host or gateway to calculate a correct routing table. However, that is still not quite enough to make it useful in practice. The proofs referred to above only show that the routing tables will converge to the correct values in finite time. They do not guarantee that this time will be small enough to be useful, nor do they say what will happen to the metrics for networks that become inaccessible.

We choose a large metric value to represent "infinity". This value must be large enough that no real metric would ever get that large. For the purposes of this example, we will use the value 16. Suppose a network becomes inaccessible. All of the immediately neighboring gateways time out and set the metric for that network to 16. For purposes of analysis, we can assume that all the neighboring gateways have gotten a new piece of hardware that connects them directly to the vanished network, with a cost of 16. Since that is the only connection to the vanished

8

© vinod vaze

Page 56: Vaze's QB on IT

QB on IT for TY BSc. (IT)

network, all the other gateways in the system will converge to new routes that go through one of those gateways. It is easy to see that once convergence has happened; all the gateways will have metrics of at least 16 for the vanished network. Gateways one hop away from the original neighbors would end up with metrics of at least 17; gateways two hops away would end up with at least 18, etc. As these metrics are larger than the maximum metric value, they are all set to 16. It is obvious that the system will now converge to a metric of 16 for the vanished network at all gateways.

We are trying to show why certain features are needed. Note that the letters correspond to gateways, and the lines to networks.

A-----B \ / \ \ / | C / all networks have cost 1, except | / For the direct link from C to D, which |/ Has cost 10 D |<=== Target network

Each gateway will have a table showing a route to each network. However, for purposes of this illustration, we show only the routes from each gateway to the network marked at the bottom of the diagram. D: directly connected, metric 1 B: route via D, metric 2C: route via B, metric 3A: route via B, metric 3

Now suppose that the link from B to D fails. The routes should now adjust to use the link from C to D. The routing changes start when B notices that the route to D is no longer usable. For simplicity, the chart below assumes that all gateways send updates at the same time. The chart shows the metric for the target network, as it appears in the routing table at each gateway.

Time ------>

D: dir, 1 dir, 1 dir, 1 dir, 1 ... dir, 1 dir, 1 B: unreach C, 4 C, 5 C, 6 C, 11 C, 12 C: B, 3 A, 4 A, 5 A, 6 A, 11 D, 11 A: B, 3 C, 4 C, 5 C, 6 C, 11 C, 12

Dir = directly connected Unreach = unreachable

© vinod vaze

Page 57: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Here's the problem: B is able to get rid of its failed route using a timeout mechanism. But vestiges of that route persist in the system for a long time. Initially, A and C still think they can get to D via B. So, they keep sending updates listing metrics of 3. In the next iteration, B will then claim that it can get to D via either A or C. Of course, it can't. The routes being claimed by A and C are now gone, but they have no way of knowing that yet. And even when they discover that their routes via B have gone away, they each think there is a route available via the other The worst case is when a network becomes completely inaccessible from some part of the system. In that case, the metrics may increase slowly in a pattern like the one above until they finally reach infinity. For this reason, the problem is called "counting to infinity".

You should now see why "infinity" is chosen to be as small as possible. If a network becomes completely inaccessible, we want counting to infinity to be stopped as soon as possible. Infinity must be large enough that no real route is that big. But it shouldn't be any bigger than required. Thus the choice of infinity is a tradeoff between network size and speed of convergence in case counting to infinity happens. The designers of RIP believed that the protocol was unlikely to be practical for networks with a diameter larger than 15.

There are several things that can be done to prevent problems like this. The ones used by RIP are called "split horizon with poisoned reverse", and "triggered updates".

© vinod vaze

Page 58: Vaze's QB on IT

QB on IT for TY BSc. (IT)

303 Q.: How remote objects are used with reference to distributed application?

The remote objects are used with reference to distributed application by using RMI.

Distributed objects are software modules that are designed to work together, but reside either in multiple computers connected via a network or in different processes inside the same computer. One object sends a message to another object in a remote machine or process to perform some task. The results are sent back to the calling object.

The RMI (Java Remote Method Invocation) system is a mechanism that enables an object on one Java virtual machine to invoke methods on an object in another Java virtual machine. Any object whose methods can be invoked in this way must implement the java.rmi.Remote interface. When such an object is invoked, its arguments are marshalled and sent from the local virtual machine to the remote one, where the arguments are unmarshalled and used. When the method terminates, the results are marshalled from the remote machine and sent to the caller's virtual machine.

To make a remote object accessible to other virtual machines, a program typically registers it with the RMI registry. The program supplies to the registry the string name of the remote object as well as the remote object itself. When a program wants to access a remote object, it supplies the object's string name to the registry that is on the same machine as the remote object. The registry returns to the caller a reference (called stub) to the remote object. When the program receives the stub for the remote object, it can invoke methods on the object (through the stub).

A program can also obtain references to remote objects as a result of remote calls to other remote objects or from other naming services. For example, the program can look up a reference to a remote object from an LDAP server that supports the schema defined RFC 2713.

Distributed objects are implemented in Objective-C using the Cocoa API with the NSConnection class and supporting objects.

Distributed objects are used in Java RMI. CORBA lets one build distributed mixed object systems. DCOM is a framework for distributed objects on the Microsoft

platform. DDObjects is a framework for distributed objects using Borland

Delphi.

© vinod vaze

Page 59: Vaze's QB on IT

QB on IT for TY BSc. (IT)

304

JavaSpaces is a Sun specification for a distributed, shared memory (spaces based)

Pyro is a framework for distributed objects using the Python programming language.

Distributed Ruby (DRb) is a framework for distributed objects using the Ruby programming language.

Q. How many bytes are empty in a RIP message that advertises ‘N’ Network?

Ans: The format of RIP message is shown as below:

Command. This 8-bit field specifies the type of message: request (1) or response (2)

Version. This 8-bit field defines the version. In this book we use version 1, but at the end of this section, we give some new features of version 2.

Family. This 16-bit field defines the family of the protocol used. For TCP/IP value is 2.

Network address. The address field defines the address of the destination network. RIP has allocated 14 bytes for this field to be applicable to any Protocol. However, IP currently uses only 4 bytes. The rest of the address is filled with "0"s

Distance. This 32-bit field defines the hop count from the advertising router to the destination network.

© vinod vaze

32 bits = 4 bytes 16 bits = 2 bytes

8 bits

Page 60: Vaze's QB on IT

QB on IT for TY BSc. (IT)

305

Note that part of the message is repeated for each destination network. We refer to this as an entry.

Thus the first line is a common factor: The first line occupies 4 bytesThe remaining 5 lines are repeated for every network.

If there are “n” networks

When we observe the following the repeated row are occupied as below:

Row Used Used by field Empty Total1 2 Family 2 42 4 Network Address 0 43 0 --- 4 44 0 --- 4 45 4 Distance 0 4

Total 10

Thus The numbers of bytes are empty in a RIP message that advertises ‘N’ Network would be 10 x “N”.

Q. Which are the types of messages used by RIP?

RIP has two types of messages:

Request and response.

A request message is sent by a router that has just come up or by a rc has some time-out entries. A request can ask about specific entries or all (see Figure below)

A response can be either solicited or unsolicited. A solicited response is sent only in answer to a request. It contains information about the destination specified in the corresponding request. An unsolicited response, on the other hand, is sent

© vinod vaze

Page 61: Vaze's QB on IT

QB on IT for TY BSc. (IT)

306

periodically, every 30 s or when there is a change in the routing table. The response is sometime called an update packet. Figure 14.9 shows the response message format.

Q. Which are the times used by RIP?

RIP uses three timers to support its operation:

The periodic timer controls the sending of messages, the expiration timer governs the validity of a route. and the garbage collection timer advertises the failure of a route

Periodic Timer

The periodic timer controls the advertising of regular update messages. Although the protocol specifies that this timer must be set to 30 s, the working model uses a random number between 25 and 35 s. This is to prevent any possible synchronization and therefore overload on an internet if routers update simultaneously.

Each router has one periodic timer that is randomly set to a number between 2\ and 35. It counts down; when zero is reached, the update message is sent, and the timer is randomly set once again.

Expiration Timer

The expiration timer governs the validity of a route. When a router receives update information for a route, the expiration timer is set to 180 s for that particular route. Every time a new update for the route is received, the timer is reset. In normal situations this occurs every 30 s. However, if there is a problem on an Internet and no update is received within the allotted 180 s, the route is considered expired and the hop count of the route is set to 16, which means the destination is unreachable. Every route has its own expiration timer.

When the information about a route becomes invalid, the router does not

© vinod vaze

Page 62: Vaze's QB on IT

QB on IT for TY BSc. (IT)

307

immediately purge that route from its table. Instead, it continues to advertise the route with a metric value of 16. At the same time, a timer called the garbage collection timer is set to 120 s for that route. When the count reaches zero, the route is purged from the table. This timer allows neighbors to become aware of the invalidity of a route prior to purging

Numerical problem: A routing table has 20 entries. It does not receive information about five routes for many timers are running at this time?

Solution

The 21 timers are listed below:Periodic timer: 1Expiration timer: 20 - 5 = 15 Garbage collection timer: 5

Q. Write notes on RIP Version 2

RIP version 2 was designed to overcome some of the shortcomings of version 1. The designers of version 2 have not augmented the length of the message for each entry. They have only replaced those fields in version 1 that were filled with as for the TCP/IP protocol with some new fields.

Format of RIP Ver 2

Figure shows the format of a RIP version 2 message.

The new fields of this message are as follows:

Route tag. This field carries information such as the autonomous

© vinod vaze

Page 63: Vaze's QB on IT

QB on IT for TY BSc. (IT)

system number. It can be used to enable RIP to receive information from an interdomain routing protocol.

Subnet mask. This is a 4-byte field that carries the subnet mask (or prefix). This means that RIP2 supports classless addressing and CIDR.

Next-hop address. This field shows the address of the next hop. This is particularly useful if two autonomous systems share a network (a backbone, for example). Then the message can define the router, in the same autonomous system or another autonomous system, to which the packet next goes.

Classless Addressing: Probably the most important difference between the two versions of RI is classwise versus classless addressing.

RIPv1 uses classwise addressing. The only entry III the message format is the network address (with a default mask).

RIPv2 adds one field for the subnet mask, which can be used to define a network prefix length. This means that in this version, we can use classless addressing. A group of networks can be combined into one prefix and advertised collectively,

End of notes

308309310311312313314

© vinod vaze

Page 64: Vaze's QB on IT

QB on IT for TY BSc. (IT)

400 OSPF [Open Shortest Path First]

401 Show the autonomous system with the following specifications:(i) There are eight networks (N1 to N8)(ii) There are eight routers (R1 to R8)(iii) N1, N2, N3, N4, AND N5 are Ethernet networks(iv) N6 is a Token Ring(v) N7 and N8 are point-to-point networks(vi) R1 connects N1 and N2(vii) R2 connects N1 and N7(viii) R3 connects N2 and N3(ix) R4 connects N7 and N5(x) R5 connects N6 and N3(xi) R6 connects N6 and N4(xii) R7 connects N6 and N5(xiii) R8 connects N8 and N5Draw the graphical representation of the above autonomous system as seen by OSPF. (May 2004)

© vinod vaze

Page 65: Vaze's QB on IT

QB on IT for TY BSc. (IT)

500 BGP [Border Gateway Protocol]

501 State the Dijkstra algorithm and explain with the help of an example (May 2006)

Explain the Path Vector Routing. Compare it with Distance Vector Routing message packet used by Border Gateway and Link State Routing. Explain the field of Update Protocol. (May 2006)

Ans:

Distance vector and link state routing are both intra-domain routing protocols. They are used inside an autonomous system, but not between autonomous systems. Both of these routing protocols become intractable in large networks and cannot be used in Inter-domain routing. Distance vector routing is subject to instability if there are more than few hops in the domain. Link state routing needs huge amount of resources to calculate routing tables. It also creates heavy traffic because of flooding.

Path vector routing is used for inter-domain routing. It is similar to Distance vector routing. In path vector routing we assume there is one node (there can be many) in each autonomous system which acts on behalf of the entire autonomous system. This node is called the speaker node. The speaker node creates a routing table and advertises it to neighboring speaker nodes in neighboring autonomous systems. The idea is the same as Distance vector routing except that only speaker nodes in each autonomous system can communicate with each other. The speaker node advertises the path, not the metric of the nodes, in its autonomous system or other autonomous systems. Path vector routing is discussed in RFC 1322; the path vector routing algorithm is somewhat similar to the distance vector algorithm in the sense that each border router advertises the destinations it can reach to its neighboring router. However, instead of advertising networks in terms of a destination and the distance to that destination, networks are advertised as destination addresses and path

© vinod vaze

Page 66: Vaze's QB on IT

QB on IT for TY BSc. (IT)

descriptions to reach those destinations. A route is defined as a pairing between a destination and the attributes of the path to that destination, thus the name, path vector routing, where the routers receive a vector that contains paths to a set of destinations. The path, expressed in terms of the domains (or confederations) traversed so far, is carried in a special path attribute that records the sequence of routing domains through which the reachability information has passed. The path represented by the smallest number of domains becomes the preferred path to reach the destination.

BGP Update Message Fields

BGP packets in which the type field in the header identifies the packet to be a BGP update message packet include the following fields. Upon receiving an update message packet, routers will be able to add or delete specific entries from their routing tables to ensure accuracy. Update messages consist of the following packets:

Unfeasible Routes Length---Indicates the total length of the withdrawn routes field or that the field is not present.

Withdrawn Routes---Contains a list of IP address prefixes for routes being withdrawn from service.

Total Path Attribute Length---Indicates the total length of the path attributes field or that the field is not present.

Path Attributes---Describes the characteristics of the advertised path. The following are possible attributes for a path:

Origin: Mandatory attribute that defines the origin of the path information

AS Path: Mandatory attribute composed of a sequence of autonomous system path segments

Next Hop: Mandatory attribute that defines the IP address of the border router that should be used as the next hop to destinations listed in the network layer reachability information field

Mult Exit Disc: Optional attribute used to discriminate between multiple exit points to a neighboring autonomous system

Local Pref: Discretionary attribute used to specify the degree of preference for an advertised route

Atomic Aggregate: Discretionary attribute used to disclose information about route selections

Aggregator: Optional attribute that contains information about aggregate routes

Network Layer Reachability Information---Contains a list of IP address prefixes for the advertised routes

© vinod vaze

Page 67: Vaze's QB on IT

QB on IT for TY BSc. (IT)

502 What different types of message BGP uses? Explain use of each Message Type? (May 2005)

Ans:

BGP Message Types

Four BGP message types are specified in RFC 1771, A Border Gateway Protocol 4 (BGP-4): open message, update message, notification message, and keep-alive message.

The open message opens a BGP communications session between peers and is the first message sent by each side after a transport-protocol connection is established. Open messages are confirmed using a keep-alive message sent by the peer device and must be confirmed before updates, notifications, and keep-alive can be exchanged.

An update message is used to provide routing updates to other BGP systems, allowing routers to construct a consistent view of the network topology. Updates are sent using the Transmission-Control Protocol (TCP) to ensure reliable delivery. Update messages can withdraw one or more unfeasible routes from the routing table and simultaneously can advertise a route while withdrawing others.

The notification message is sent when an error condition is detected. Notifications are used to close an active session and to inform any connected routers of why the session is being closed.The keep-alive message notifies BGP peers that a device is active. Keep-alive are sent often enough to keep the sessions from expiring.

503 In case of OSPF protocol, explain the following terminologyi areaii. Metriciii. LinkWhat different types of link exist? What is the purpose of each link type? (May 2005)

Ans:

An OSPF network can be divided into sub-domains called areas. An area is a logical collection of OSPF networks, routers, and links that have the same area identification.. A router within an area must maintain a topological database for the area to which it belongs. The router doesn't

© vinod vaze

Page 68: Vaze's QB on IT

QB on IT for TY BSc. (IT)

have detailed information about network topology outside of its area, thereby reducing the size of its database.

Areas limit the scope of route information distribution. It is not possible to do route update filtering within an area. The link-state database (LSDB) of routers within the same area must be synchronized and be exactly the same; however, route summarization and filtering is possible between different areas. The main benefit of creating areas is a reduction in the number of routes to propagate—by the filtering and the summarization of routes.Each OSPF network that is divided into different areas must follow these rules:

A backbone area—which combines a set of independent areas into a single domain—must exist.

Each non-backbone area must be directly connected to the backbone area (though this connection might be a simple logical connection through a virtual link,).

The backbone area must not be partitioned—divided into smaller pieces—under any failure conditions, such as link or router down events.

Metric

The OSPF allows the administrator to assign a cost, called the metric, to each route.The metric can be based on a type of service.As a matter of fact, a router can have multiple routing tables, each based on different type of service

Links:

A point-to-point link is a dedicated link that connects exactly two communication facilities (e.g., two nodes of a network, an intercom station at an entryway with a single internal intercom station, a radio path between two points, etc.).

Transience means passing with time. Something which has the property of transience is said to be transient, or often simply a transient or transient state.Example include:

A transient astronomical event is a phenomenon that is relatively short-lived by astronomical standards. Examples include supernovae, comets, and meteors.

© vinod vaze

Page 69: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Virtual link

When the link between two routers is broken , the administration may create a virtual link between them using a longer path that probably goes through a several routers.

504

505 What are the different types of message used by Border Gateway Protocol? Explain the Border Gateway Protocol Header; explain the fields of Open message packet. (October 2005)

Ans:

All BGP message types use the basic packet header. Open, update, and notification messages have additional fields, but keep-alive messages use only the basic packet header. Figure 35-3 illustrates the fields used in the BGP header. The section that follows summarizes the function of each field.

BGP Packet-Header Fields

Each BGP packet contains a header whose primary purpose is to identify the function of the packet in question. The following descriptions summarize the function of each field in the BGP header illustrated in Figure 35-3. · Marker---Contains an authentication value that the message receiver can predict · Length---Indicates the total length of the message in bytes. · Type---Type --- Specifies the message type as one of the following: · Open · Update · Notification · Keep-alive · Data---Contains upper-layer information in this optional field. BGP Open Message Fields

BGP packets in which the type field in the header identifies the packet to be a BGP open message packet include the following fields. These fields provide the exchange criteria for two BGP routers to establish a peer relationship.

8

© vinod vaze

Page 70: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Version---Provides the BGP version number so that the recipient

can determine whether it is running the same version as the sender.

Autonomous System---Provides the autonomous system number

of the sender

Hold-Time---Indicates the maximum number of seconds that can

elapse without receipt of a message before the transmitter is assumed to be nonfunctional.

BGP Identifier---Provides the BGP identifier of the sender (an IP

address), which is determined at startup and is identical for all local interfaces and all BGP peers.

Optional Parameters Length---Indicates the length of the optional

parameters field (if present).

Optional Parameters---Contains a list of optional parameters (if any). Only one optional parameter type is currently defined: authentication information.

506 8

507 State the Dijkstra algorithm and explain with the help of an example (May 2006)

Explain the Path Vector Routing. Compare it with Distance Vector Routing message packet used by Border Gateway and Link State Routing. Explain the field of Update Protocol. (May 2006)

Ans:

Distance vector and link state routing are both intra-domain routing protocols. They are used inside an autonomous system, but not between autonomous systems. Both of these routing protocols become intractable in large networks and cannot be used in Inter-domain routing. Distance vector routing is subject to instability if there are more than few hops in the domain. Link state routing needs huge amount of resources to calculate routing tables. It also creates heavy traffic because of flooding.

Path vector routing is used for inter-domain routing. It is similar to Distance vector routing. In path vector routing we assume there is one

© vinod vaze

Page 71: Vaze's QB on IT

QB on IT for TY BSc. (IT)

node (there can be many) in each autonomous system which acts on behalf of the entire autonomous system. This node is called the speaker node. The speaker node creates a routing table and advertises it to neighboring speaker nodes in neighboring autonomous systems. The idea is the same as Distance vector routing except that only speaker nodes in each autonomous system can communicate with each other. The speaker node advertises the path, not the metric of the nodes, in its autonomous system or other autonomous systems. Path vector routing is discussed in RFC 1322; the path vector routing algorithm is somewhat similar to the distance vector algorithm in the sense that each border router advertises the destinations it can reach to its neighboring router. However, instead of advertising networks in terms of a destination and the distance to that destination, networks are advertised as destination addresses and path descriptions to reach those destinations. A route is defined as a pairing between a destination and the attributes of the path to that destination, thus the name, path vector routing, where the routers receive a vector that contains paths to a set of destinations. The path, expressed in terms of the domains (or confederations) traversed so far, is carried in a special path attribute that records the sequence of routing domains through which the reachability information has passed. The path represented by the smallest number of domains becomes the preferred path to reach the destination.

BGP Update Message Fields

BGP packets in which the type field in the header identifies the packet to be a BGP update message packet include the following fields. Upon receiving an update message packet, routers will be able to add or delete specific entries from their routing tables to ensure accuracy. Update messages consist of the following packets:

Unfeasible Routes Length---Indicates the total length of the withdrawn routes field or that the field is not present.

Withdrawn Routes---Contains a list of IP address prefixes for

routes being withdrawn from service. Total Path Attribute Length---Indicates the total length of the path

attributes field or that the field is not present.

Path Attributes---Describes the characteristics of the advertised path. The following are possible attributes for a path:

Origin: Mandatory attribute that defines the origin of the path information

© vinod vaze

Page 72: Vaze's QB on IT

QB on IT for TY BSc. (IT)

AS Path: Mandatory attribute composed of a sequence of autonomous system path segments

Next Hop: Mandatory attribute that defines the IP address of the border router that should be used as the next hop to destinations listed in the network layer reachability information field

Mult Exit Disc: Optional attribute used to discriminate between multiple exit points to a neighboring autonomous system

Local Pref: Discretionary attribute used to specify the degree of preference for an advertised route

Atomic Aggregate: Discretionary attribute used to disclose information about route selections

Aggregator: Optional attribute that contains information about aggregate routes

Network Layer Reachability Information---Contains a list of IP address prefixes for the advertised routes

508 What different types of message BGP uses? Explain use of each Message Type? (May 2005)

Ans:

BGP Message Types

Four BGP message types are specified in RFC 1771, A Border Gateway Protocol 4 (BGP-4): open message, update message, notification message, and keep-alive message.

The open message opens a BGP communications session between peers and is the first message sent by each side after a transport-protocol connection is established. Open messages are confirmed using a keep-alive message sent by the peer device and must be confirmed before updates, notifications, and keep-alive can be exchanged.

An update message is used to provide routing updates to other BGP systems, allowing routers to construct a consistent view of the network topology. Updates are sent using the Transmission-Control Protocol

© vinod vaze

Page 73: Vaze's QB on IT

QB on IT for TY BSc. (IT)

(TCP) to ensure reliable delivery. Update messages can withdraw one or more unfeasible routes from the routing table and simultaneously can advertise a route while withdrawing others.

The notification message is sent when an error condition is detected. Notifications are used to close an active session and to inform any connected routers of why the session is being closed.

The keep-alive message notifies BGP peers that a device is active. Keep-alive are sent often enough to keep the sessions from expiring.

509 What are the different types of message used by Border Gateway Protocol? Explain the Border Gateway Protocol Header; explain the fields of Open message packet. (October 2005)

Ans:

All BGP message types use the basic packet header. Open, update, and notification messages have additional fields, but keep-alive messages use only the basic packet header. Figure 35-3 illustrates the fields used in the BGP header. The section that follows summarizes the function of each field.

BGP Packet-Header Fields

Each BGP packet contains a header whose primary purpose is to identify the function of the packet in question. The following descriptions summarize the function of each field in the BGP header illustrated in Figure 35-3. · Marker---Contains an authentication value that the message receiver can predict

· Length---Indicates the total length of the message in bytes.

· Type---Type --- Specifies the message type as one of the following:

Open Update Notification Keep-alive Data---Contains upper-layer information in this

optional field.

© vinod vaze

Page 74: Vaze's QB on IT

QB on IT for TY BSc. (IT)

BGP Open Message Fields

BGP packets in which the type field in the header identifies the packet to be a BGP open message packet include the following fields. These fields provide the exchange criteria for two BGP routers to establish a peer relationship.

Version---Provides the BGP version number so that the recipient can determine whether it is running the same version as the sender.

Autonomous System---Provides the autonomous system number of the sender

Hold-Time---Indicates the maximum number of seconds that can elapse without receipt of a message before the transmitter is assumed to be nonfunctional.

BGP Identifier---Provides the BGP identifier of the sender (an IP address), which is determined at startup and is identical for all local interfaces and all BGP peers.

Optional Parameters Length---Indicates the length of the optional parameters field (if present).

Optional Parameters---Contains a list of optional parameters (if any). Only one optional parameter type is currently defined: authentication information.

510 Explain the five types of Link State Advertisements used by Open Shortest Path first protocol (October 2005)(8)

Ans: -

The LSA types defined in OSPF are as follows:

Type 1 - Router LSA - the router lists the links to other routers or networks in the same area, together with the metric. Type 1 LSAs are flooded across their own area only. The link-state ID of the type 1 LSA is the originating router ID.

Type 2 - Network LSA - the designated router on a broadcast segment (e.g. Ethernet) lists which routers are joined together by the

© vinod vaze

Page 75: Vaze's QB on IT

QB on IT for TY BSc. (IT)

segment. Type 2 LSAs are flooded across their own area only. The link-state ID of the type 2 LSA is the IP interface address of the DR.

Type 3 - Summary LSA - an Area Border Router (ABR) takes information it has learned on one of its attached areas and it can summarizes it (but not by default) before sending it out on other areas it is connected to. This summarization helps provide scalability by removing detailed topology information for other areas, because their routing information is summarized into just an address prefix and metric. The summarization process can also be configured to remove a lot of detailed address prefixes and replace them with a single summary prefix, also helping scalability. The link-state ID is the destination network number for type 3 LSAs.

Type 4 - ASBR-Summary LSA - this is needed because Type 5 External LSAs are flooded to all areas and the detailed next-hop information may not be available in those other areas. This is solved by an Area Border Router flooding the information for the router (i.e. the Autonomous System Border Router) where the type 5 originated. The link-state ID is the router ID of the described ASBR for type 4 LSAs.

Type 5 - External LSA - these LSAs contain information imported into OSPF from other routing processes. They are flooded to all areas (except stub areas). For "External Type 1" LSAs routing decisions are made by adding the OSPF metric to get to the ASBR and the external metric from there on, while for "External Type 2" LSAs only the external metric is used. The link-state ID of the type 5 LSA is the external network number.

511

512

513

514

515

© vinod vaze

Page 76: Vaze's QB on IT

QB on IT for TY BSc. (IT)

601 Socket Programming

602 Socket Programming

603 Socket Programming

604 Socket Programming

605 Socket Programming

606 Socket Programming

607 Socket Programming

608Socket Programming

609 Socket Programming

610 Socket Programming

700 RMI Remote Method Invocation

701RMIWrite a short note on Marshalling and Un-marshalling. (November 2004)

Ans: -

© vinod vaze

Page 77: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Marshaling and Un-marshaling

In normal circumstances a program will transmit data using following steps:

1. Get the Internet address of the remote host. 2. Open a Socket connection to the server3. Convert the data to be transmitted into an ASCII value or a

byte stream. 4. Read the server response and convert the ASCII value into

the required type.

The task of converting the argument type to the ASCII is called Marshaling the value.

The Task of converting the return value to the client data type is called un-marshaling the value.

In RMI marshaling and un-marshaling are done automatically for objects as well as primitive data types. To do this, it uses java serialization facility. It serializes the argument and return values transfers them over the network and de-serialises them for use. Therefore any object that implements the interface java.io. serializeable can be sent or received as a argument or return value.

702RMIWrite a short note on distributing and installing RMI software (May 2004)

Ans: -

Distributing and Installing RMI Software

RMI adds support for a Distributed Class model to the Java platform and extends Java technology's reach to multiple JVMs. It should not be a surprise that installing an RMI system is more involved than setting up a Java runtime on a single computer. In this section, you will learn about the issues related to installing and distributing an RMI based system.

For the purposes of this section, it is assumed that the overall process of designing a DC system has led you to the point where you must consider the allocation of processing to nodes. And you are trying to determine how to install the system onto each node.

RMI

© vinod vaze

Page 78: Vaze's QB on IT

QB on IT for TY BSc. (IT)

703 With the help of a neat diagram describe the RMI architecture (May 2004) & (November 2004)

Ans: -

RMI Architecture Layers

With an understanding of the high-level RMI architecture, take a look under the covers to see its implementation.

The RMI implementation is essentially built from three abstraction layers. The first is the Stub and Skeleton layer, which lies just beneath the view of the developer. This layer intercepts method calls made by the client to the interface reference variable and redirects these calls to a remote RMI service.

The next layer is the Remote Reference Layer. This layer understands how to interpret and manage references made from clients to the remote service objects. In JDK 1.1, this layer connects clients to remote service objects that are running and exported on a server. The connection is a one-to-one (unicast) link. In the Java 2 SDK, this layer was enhanced to support the activation of dormant remote service objects via Remote Object Activation.

The transport layer is based on TCP/IP connections between machines in a network. It provides basic connectivity, as well as some firewall penetration strategies.

By using a layered architecture each of the layers could be enhanced or replaced without affecting the rest of the system. For example, the transport layer could be replaced by a UDP/IP layer without affecting the upper layers.

Stub and Skeleton Layer

The stub and skeleton layer of RMI lie just beneath the view of the Java

© vinod vaze

Page 79: Vaze's QB on IT

QB on IT for TY BSc. (IT)

developer. In this layer, RMI uses the Proxy design pattern as described in the book, Design Patterns by Gamma, Helm, Johnson and Vlissides. In the Proxy pattern, an object in one context is represented by another (the proxy) in a separate context. The proxy knows how to forward method calls between the participating objects. The following class diagram illustrates the Proxy pattern.

In RMI's use of the Proxy pattern, the stub class plays the role of the proxy, and the remote service implementation class plays the role of the RealSubject.

A skeleton is a helper class that is generated for RMI to use. The skeleton understands how to communicate with the stub across the RMI link. The skeleton carries on a conversation with the stub; it reads the parameters for the method call from the link, makes the call to the remote service implementation object, accepts the return value, and then writes the return value back to the stub.

In the Java 2 SDK implementation of RMI, the new wire protocol has made skeleton classes obsolete. RMI uses reflection to make the connection to the remote service object. You only have to worry about skeleton classes and objects in JDK 1.1 and JDK 1.1 compatible system implementations.

Remote Reference Layer

The Remote Reference Layers defines and supports the invocation semantics of the RMI connection. This layer provides a RemoteRef object that represents the link to the remote service implementation object.

The stub objects use the invoke() method in RemoteRef to forward the method call. The RemoteRef object understands the invocation semantics

© vinod vaze

Page 80: Vaze's QB on IT

QB on IT for TY BSc. (IT)

for remote services.

The JDK 1.1 implementation of RMI provides only one way for clients to connect to remote service implementations: a unicast, point-to-point connection. Before a client can use a remote service, the remote service must be instantiated on the server and exported to the RMI system. (If it is the primary service, it must also be named and registered in the RMI Registry).

The Java 2 SDK implementation of RMI adds a new semantic for the client-server connection. In this version, RMI supports activatable remote objects. When a method call is made to the proxy for an activatable object, RMI determines if the remote service implementation object is dormant. If it is dormant, RMI will instantiate the object and restore its state from a disk file. Once an activatable object is in memory, it behaves just like JDK 1.1 remote service implementation objects.

Other types of connection semantics are possible. For example, with multicast, a single proxy could send a method request to multiple implementations simultaneously and accept the first reply (this improves response time and possibly improves availability). In the future, Sun may add additional invocation semantics to RMI.

Transport Layer

The Transport Layer makes the connection between JVMs. All connections are stream-based network connections that use TCP/IP.

Even if two JVMs are running on the same physical computer, they connect through their host computer's TCP/IP network protocol stack. (This is why you must have an operational TCP/IP configuration on your computer to run the Exercises in this course). The following diagram shows the unfettered use of TCP/IP connections between JVMs.

© vinod vaze

Page 81: Vaze's QB on IT

QB on IT for TY BSc. (IT)

As you know, TCP/IP provides a persistent, stream-based connection between two machines based on an IP address and port number at each end. Usually a DNS name is used instead of an IP address; this means you could talk about a TCP/IP connection between flicka.magelang.com: 3452 and rosa.jguru.com: 4432. In the current release of RMI, TCP/IP connections are used as the foundation for all machine-to-machine connections.

On top of TCP/IP, RMI uses a wire level protocol called Java Remote Method Protocol (JRMP). JRMP is a proprietary, stream-based protocol that is only partially specified is now in two versions. The first version was released with the JDK 1.1 version of RMI and required the use of Skeleton classes on the server. The second version was released with the Java 2 SDK. It has been optimized for performance and does not require skeleton classes. (Note that some alternate implementations, such as BEA Web logic and Ninja do not use JRMP, but instead use their own wire level protocol. ObjectSpace's Voyager does recognize JRMP and will interoperate with RMI at the wire level.) Some other changes with the Java 2 SDK are that RMI service interfaces are not required to extend from java.rmi.Remote and their service methods do not necessarily throw RemoteException.

704 RMIHow does RMI overcome the issues arising due to firewalls? Explain in detail. (November 2004)

Ans: -

Firewall Issues

Firewalls are inevitably encountered by any networked enterprise application that has to operate beyond the sheltering confines of an Intranet. Typically, firewalls block all network traffic, with the exception of those intended for certain "well-known" ports.

Since the RMI transport layer opens dynamic socket connections between the client and the server to facilitate communication, the JRMP traffic is typically blocked by most firewall implementations. But luckily, the RMI designers had anticipated this problem, and a solution is provided by the RMI transport layer itself. To get across firewalls, RMI makes use of HTTP tunneling by encapsulating the RMI calls within an HTTP POST request.

Now, examine how HTTP tunneling of RMI traffic works by taking a closer

4

© vinod vaze

Page 82: Vaze's QB on IT

QB on IT for TY BSc. (IT)

look at the possible scenarios: the RMI client, the server, or both can be operating from behind a firewall. The following diagram shows the scenario where an RMI client located behind a firewall communicates with an external server.

In the above scenario, when the transport layer tries to establish a connection with the server, it is blocked by the firewall. When this happens, the RMI transport layer automatically retries by encapsulating the JRMP call data within an HTTP POST request. The HTTP POST header for the call is in the form:

http://hostname: port

If a client is behind a firewall, it is important that you also set the system property http.proxyHost appropriately. Since almost all firewalls recognize the HTTP protocol, the specified proxy server should be able to forward the call directly to the port on which the remote server is listening on the outside. Once the HTTP-encapsulated JRMP data is received at the server, it is automatically decoded and dispatched by the RMI transport layer. The reply is then sent back to client as HTTP-encapsulated data.

The following diagram shows the scenario when both the RMI client and server are behind firewalls, or when the client proxy server can forward data only to the well-known HTTP port 80 at the server.

© vinod vaze

Page 83: Vaze's QB on IT

QB on IT for TY BSc. (IT)

In this case, the RMI transport layer uses one additional level of indirection! This is because the client can no longer send the HTTP-encapsulated JRMP calls to arbitrary ports as the server is also behind a firewall. Instead, the RMI transport layer places JRMP call inside the HTTP packets and send those packets to port 80 of the server. The HTTP POST header is now in the form

http://hostname: 80/cgi-bin/java-rmi?forward=<port>

This causes the execution of the CGI script, java-rmi.cgi, which in turn invokes a local JVM, unbundles the HTTP packet, and forwards the call to the server process on the designated port. RMI JRMP-based replies from the server are sent back as HTTP REPLY packets to the originating client port where RMI again unbundles the information and sends it to the appropriate RMI stub.

Of course, for this to work, the java-rmi.cgi script, which is included within the standard JDK 1.1 or Java 2 platform distribution, must be preconfigured with the path of the Java interpreter and located within the web server's cgi-bin directory. It is also equally important for the RMI server to specify the host's fully-qualified domain name via a system property upon startup to avoid any DNS resolution problems, as:

java.rmi.server.hostname=host.domain.com

Note: Rather than making use of CGI script for the call forwarding, it is more efficient to use a servlet implementation of the same. You should be able to obtain the servlet's source code from Sun's RMI FAQ.

© vinod vaze

Page 84: Vaze's QB on IT

QB on IT for TY BSc. (IT)

It should be noted that notwithstanding the built-in mechanism for overcoming firewalls, RMI suffers a significant performance degradation imposed by HTTP tunneling. There are other disadvantages to using HTTP tunneling too. For instance, your RMI application will no longer be able to multiplex JRMP calls on a single connection, since it would now follow a discrete request/response protocol. Additionally, using the java-rmi.cgi script exposes a fairly large security loophole on your server machine, as now; the script can redirect any incoming request to any port, completely bypassing your firewalling mechanism. Developers should also note that using HTTP tunneling precludes RMI applications from using callbacks, which in itself could be a major design constraint. Consequently, if a client detects a firewall, it can always disable the default HTTP tunneling feature by setting the property:

705RMIWrite the programs for the following using RMI:i To invoke a remote method to find length of a string.ii. To invoke a remote method to for changing the case of letters in a given string. (May 2005)

Ans: -

1] To invoke a remote method to find length of a string :-

Import java.io. *;Import java.net.*;Class echo ClientPublic static void main(String args[])Int port=9999;Socket s;String msg=””;

TryBuffer reader br=new buffered reader (new input Stream Reader(System. in));InetAddressAddr=InetAddress.getByName(nul);S=new Socket(add.port);

Output streamWriter osw=new Output streamWriter( s.getOutputStream());

8

© vinod vaze

Page 85: Vaze's QB on IT

QB on IT for TY BSc. (IT)

PrintWrite pw=new PrintWriter(osw);Buffer reader br 1=new Buffer reader (new input Stream Reader( s.getinputStream());String str=br.readline();Pw.println(str);Pe.flush();Msg=br1.readline();System.out.printline(“Answer from Server”+msg);Catch(Exception e)

2] To invoke a remote method to for changing the case of letters in a given string. (May 2005): -

Import java.io.*;Import java.net.*;Class case ClientPublic static viod main(String args[])Int port=9999;Socket s;String msg=””;

TryBuffer reader br=new buffered reader(new input Stream Reader(System.in));InetAddressAddr=InetAddress.getByName(nul);S=new Socket(add,port);

Output streamWriter osw=new Output streamWriter( s.getOutputStream());PrintWrite pw=new PrintWriter(osw);Buffer reader br 1=new Buffer reader (new input Stream Reader( s.getinputStream());String str=br.readline();Pw.println(str);

© vinod vaze

Page 86: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Pe.flush();Msg=br1.readline();System.out.printline(“Answer from Server”+msg);Catch(Exception e)

706 RMIWhat are the different types of parameters in RMI? How are they passed between java virtual machines? (October 2005), (May 2006)

Ans: -

Parameters in RMI

Primitive parameters - When a primitive data type is passed as a parameter to a remote method, the RMI system passes it by value. RMI will make a copy of a primitive data type and send it to the remote method. If a method returns a primitive data type, it is also returned to the calling JVM by value.

Object Parameters - When an object is passed to a remote method, the semantics change from the case of the single JVM. RMI sends the object itself, not the reference of object. It is the object that is passed by value, nor the reference to the object. Similarly when a remote method returns an object, a copy of the whole object is returned to the calling program. RMI uses a technology called Object Serialization to transform an object into a linear format that can then be sent over the network wire.

Remote Object Parameters - A client program can obtain a reference to a remote object through the RMI registry program. Another way a client can obtain a remote reference

4

707RMIExplain in detail the steps involved in building a RMI system. (October 2005)

Ans: -

Assuming that the RMI system is already designed, you take the following steps to build a system:

© vinod vaze

Page 87: Vaze's QB on IT

QB on IT for TY BSc. (IT)

1. Write and compile Java code for interfaces 2. Write and compile Java code for implementation classes 3. Generate Stub and Skeleton class files from the implementation

classes 4. Write Java code for a remote service host program 5. Develop Java code for RMI client program 6. Install and run RMI system

rmiIntf.java : -

import java.rmi.*;interface rmiIntf extends Remoteint add(int a, int b ) throws RemoteException;

rmiServerImpl.java : -

import java.rmi.*;import java.rmi.server.*;public class rmiServerImpl extends Unicast RemoteObject implements rmiServerIntfrmiServerImpl()throws RemoteExceptionPublic int add(int a, int b ) throws RemoteExceptionReturn a+b;

rmiServer.java : -

import java.rmi.*;import java.net.*;public class rmiServerPublic static viod main(String args[])TryrmiServerImpl adsi=new rmiServerImpl();Naming.rebind(“Server”,adsi);

© vinod vaze

Page 88: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Catch(Exception e)

rmiClient.java : -

import java.rmi.*;public class rmiClient extends Applet Public static viod main(String args[])rmiIntf=(rmiIntf)Naming.lookup(“Server”);System.out printline(“Addition:”+rif.add(5,4));

708RMIWhat are the components required to build a working RMI system? (May 2006)

Ans:-

It is now time to build a working RMI system and get hands-on experience. In this section, you will build a simple remote calculator service and use it from a client program.

A working RMI system is composed of several parts.

Interface definitions for the remote services Implementations of the remote services Stub and Skeleton files A server to host the remote services An RMI Naming service that allows clients to find the remote

services A class file provider (an HTTP or FTP server) A client program that needs the remote services In the next sections, you will build a simple RMI system in a step-by-step fashion. You are encouraged to create a fresh subdirectory on your computer and create these files as you read the text.

To simplify things, you will use a single directory for the client and server code. By running the client and the server out of the same directory, you will not have to set up an HTTP or FTP server to provide the class files.

8

© vinod vaze

Page 89: Vaze's QB on IT

QB on IT for TY BSc. (IT)

(Details about how to use HTTP and FTP servers as class file providers will be covered in the section on Distributing and Installing RMI Software)

Assuming that the RMI system is already designed, you take the following steps to build a system:

7. Write and compile Java code for interfaces 8. Write and compile Java code for implementation classes 9. Generate Stub and Skeleton class files from the implementation

classes 10. Write Java code for a remote service host program 11. Develop Java code for RMI client program 12. Install and run RMI system

709Practical No. 1:

Write two programs:

1. DatagramSender.java and 2. DatagramReceiver.java

Using Datagram Socket and Datagram Packet in which DatagramSender.Java transmits a datagram and DatagramReceiver.Java executes an infinite loop to receive and display datagrams (May 2004)

Ans :

//DatagramSenderimport java.net.*;

class DatagramSenderpublic static void main(String args[])tryInetAddress ia=InetAddress.getByName(args[0]);Int port = Integer.parseInt(args[1]);DatagramSocket ds = new DatagramSocket();Byte buffer[] = args[2].getBytes();DatagramPacket dp = new DatagramPacket(buffer, buffer.length, ia, port);ds.send(dp);

8

© vinod vaze

Page 90: Vaze's QB on IT

QB on IT for TY BSc. (IT)

catch(Exception e)e.printStackTrace();//DatagramReceiverimport java.net.*;classDatagramReceiverprivate final static int BUFSIZE = 20;public static void main(String args[)tryint port = Integer.parseInt(args[0]);DatagramSocket ds = new DatagramSocket(port);byte buffer[] = new byte[BUFSIZE];while(true)DatagramPacket dp = new DatagramPacket(buffer, buffer.length);ds.receive(dp);String str = new String(dp.getData());System.out.println(sr);catch(Exception e)e.printStackTrace();

Q 2

: Write a Client/Server application where a client contacts the server to cote in a random integer. Use Socket and Serve Socket. (May 2004)

Ans :ServerSocketimport java.io.*;import java.net.*;import java.util.*;class ServerSocket

© vinod vaze

Page 91: Vaze's QB on IT

QB on IT for TY BSc. (IT)

public static void main(String args[])tryint port = Integer.parseInt(args[0]);Random random = new Random();ServerSocket ss = new ServerSocket(port);while(true)Socket s = ss.accept();OutputStream os = s.getOutputStream();DataOutputStream dos = new DataOutputStream(os);dos.writeInt(random.nextInt());s.close();catch(Exception e)System.out.println(“Excpetion : “ + e);Socketimport java.io.*;import java.net.*;class Socketpublic static void main(String args[])tryString server = args[0];int port = Integer.parseInt(args[1]);Socket s = new Socket(server, port);InputStream is = s.getInputStream()DataInputStream dis = new DataInputStream(is);int i = dis.readInt();System.out.println(i);s.close()catch(Exception e)System.out.println(“Exception : “ + e);

© vinod vaze

Page 92: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Q 3

: Write a program that prints the Internet Address of the local host if we do Not specify and command line parameters or all Internet addresses of another host if we specify the host name on the command line, (November 2004)

Ans :

import java .net.*;class InetAddresspublic static void main(String args[])tryInetAdress ias[] = InetAdress.getAllByName(args[0]);for(int i =0; i < ias.length; i++)System.out.println(ias[i].getHostName());System.out.println(ias[i].gethostAddress());byte bytes[] = ias[i].getAddress();for(int j=0; j<bytes.length; j++)if(j>0)System.out.print(“.”);if(bytes[j]>=0)System.out.print(bytes[j]);else System.out.print(bytes[j] + 256);System.out.println(“”);catch(Exception e)e.printStackTrace();

Q 4.

Write a program that constructs a Socket object to connect to the

© vinod vaze

Page 93: Vaze's QB on IT

QB on IT for TY BSc. (IT)

host port using TCP, Once the connection is established, a message “Connection established” must be pirated, and the connection must be closed, Handle the errors with appropriate messages (November 2004)

Ans :programimport java.io.IOException;import java.net.Socket;import java.net.UnknownHostException;public class SimpleSocketCreatepublic static void main(String[] args)String host = “localhost”;int port = 4000;trySystem.out.println(“Attempting to connect to a TCP service on “ + host +“:” + port + “ …”);Socket socket = new Socket(host, port);System.out.println(“Connection established !”);catch(UnknownHostException e)System.err.println(“Could not resolve host name : “ e.getMessage());catch(IOException e)System.err.println(“A communication error occurred : “ +e.getClass().getName() + “:” + e.getMessage();catch(SecurityException e)System.err.println(“The security manager refused permission to “ +“conncet to the remote TCP service : “ + e.getMessage());

Q 5: Write a client/server program for the following:A client reads a line from its standard input (keyboard) and sends the lineout its socket to the server.

© vinod vaze

Page 94: Vaze's QB on IT

QB on IT for TY BSc. (IT)

The server reads a line from its connection socket.The server converts the line to uppercase.The server sends the modified line out its connection socket to the client.The client reads the modified line from its socket and prints the line on itsstandard output (monitor) (November 2004)

Ans :

//TCPClientimport java.io.*;import java.net.*;class TCPClientpublic static void main(String argv[]) throws ExceptionString sentences;String modifidSentence;BufferedReader inFronUser = new BufferedReader(newInputStreamReader(System.in));Socket clientSocket = new Socket(“hostname”, 6789);DataOutputStream outToServer = newDataOutputStream(clientSocket.getOutputStream());BufferedReader inFormServer = new BufferedReader(newInputStreamReader(clientSocket.getInputStream()));Sentence = inFromUser.readLine();outToServer.writeBytes(sentence + ‘\n’);modifiedSentence = inFromServer.readLine();System.out.println(“FROM SERVER : “ + modifiedSentence);clientSocket.close();//TCPServerimport java.io.*;import java.net.*;class TCPServerpublic static void main(String argv[]) throws ExceptionString clientSentence;String capitalizedSentence;ServerSocket welcomeSocket = new ServerSocket(6789);while(true)Socket connectionSocket = welcomeSocket.accept()

© vinod vaze

Page 95: Vaze's QB on IT

QB on IT for TY BSc. (IT)

BufferedReader inFromClient = new BufferedReader(newInputStreamReader(conectionSocket.getInputStream()));DataOutputStream outToClient = new DataOutputStream(connectionSocket.getOutputStream());clientSentence = inFromClient.readLine();capitalizedSentence = clientSentence.toUpperCase() + ‘\n’;outToClient.writebytes(capitalizedSentence);Q:6

: Write the code for the following.

The server program should create and bind to a socket, at a well knownPort and listen for client connections. Once it receives data from a Client, it should echo this back to the client and close the connection. (May 2005)

Ans :

//smtpClientimport java.io.*;import java.net.*;public class smtpClientpublic static void main(String[] args)Socket smtpSocket = null;DataOutputStream os = null;DataInputStream is = null;trysmtpSocket = new Socket(“hostname”, 25);os = new DataOutputStream(smtpSocket.getOutputStream());is = new DatInputStream(smtpSocket.getInputStream());catch(UnknownHostException e)System.err.println(“Don’t know about host: hostname”);catch(IOException e)System.err.println(“Couldn’t get I/O for the connection to : hostname”);

© vinod vaze

Page 96: Vaze's QB on IT

QB on IT for TY BSc. (IT)

if(smtpSocket!=null && os!=null && is!=null)tryos.writeBytes(“HELLO\n”);os.writeBytes(“RCPT To:[email protected]\n”);os.writeBytes(“MAIL From:[email protected]\n”);os.writeBytes(“DATA\n”);os.writeBytes(“From:[email protected]\n”);os.writeBytes(“Subject: testing\n”);os.writeBytes(“Hi there\n”);os.writeBytes(“\n.\n”);String responseLine;while((responseLine = is.readLine() != null)System.out.println(“Server: “ + responseLine);if(responseLine.indexOf(“Ok”) != 1)break;os.close();is.close()smtpSocket.close();catch(UnknownHostException e)System.err.println(“Trying to connect to unknown host: “ + e);catch(IOException e)System.err.println(“IOException: “ + e);//EchoServerimport java.io.*;import java.net.*;public class Echopublic static void main(String args[])ServerSocket echoServer = null;String line;DataInputStream is;

© vinod vaze

Page 97: Vaze's QB on IT

QB on IT for TY BSc. (IT)

PrintStream os;Socket clientSocket = null;tryechoServer = new ServerSocket(9999);catch(IOException e)System.out.println(e);tryclientSocket = echoServer.accept();is = new DataInputStream(clientSocket.getInputStream());os = new PrintStream(clientSocket.getOutputStream());while(true)line = is.readLine();os.println(line);catch(IOException e)System.out.println(e);

800CORBA

801CORBAWhat is an Object Adapter as defined in CORBA specification? Explain the different types of object adapters. (October 2005)

Ans: -

Object Adapters

The CORBA specification defines the concept of an object adapter. An object adapter is a framework for implementing CORBA objects. It

8

© vinod vaze

Page 98: Vaze's QB on IT

QB on IT for TY BSc. (IT)

provides an API that object implementations use for various low level services. According to the CORBA specification, an object adapter is responsible for the following functions:

· Generation and interpretation of object references · Method invocation · Security of interactions · Object and implementation activation and deactivation · Mapping object references to the corresponding object implementations · Registration of implementations

The architecture supports the definition of many kinds of object adapters. The specification includes the definition of the basic object adapter (BOA). In the previous section, you saw some server code that uses the services of VisiBroker's implementation of the BOA. The BOA has been implemented in various CORBA products. Unfortunately, since the specification of the BOA was not complete, the various BOA implementations differ in some significant ways. This has compromised server portability.

To address this shortcoming, an entirely new object adapter was added, the portable object adapter (POA). Unfortunately, the POA is not yet supported in many products. In any event, the BOA and the POA are described here.

Activation on Demand by the Basic Object Adapter (BOA)One of the main tasks of the BOA is to support on-demand object activation. When a client issues a request, the BOA determines if the object is currently running and if so, it delivers the request to the object. If the object is not running, the BOA activates the object and then delivers the request.

The BOA defines four different models for object activation: Shared server Multiple active objects share the same server. The server services requests from multiple clients. The server remains active until it is deactivated or exits.

Unshared server Only one object is active in the server. The server exits when the client that caused its activation exits.

Server-per-method Each request results in the creation of a server. The server exits when the method completes.

Persistent server The server is started by an entity other than the BOA (you, operating services, etc.). Multiple active objects share the server.

© vinod vaze

Page 99: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Portable Object Adapter (POA)According to the specification, "The intent of the POA, as its name suggests, is to provide an object adapter that can be used with multiple ORB implementations with a minimum of rewriting needed to deal with different vendors' implementations." However, most CORBA products do not yet support the POA.

The POA is also intended to allow persistent objects -- at least, from the client's perspective. That is, as far as the client is concerned, these objects are always alive, and maintain data values stored in them, even though physically, the server may have been restarted many times, or the implementation may be provided by many different object implementations.

The POA allows the object implementor a lot more control. Previously, the implementation of the object was responsible only for the code that is executed in response to method requests. Now, additionally, the implementor has more control over the object's identity, state, storage, and lifecycle.

The POA has support for many other features, including the following:

· Transparent object activation · Multiple simultaneous object identities · Transient objects · Object ID namespaces · Policies including multithreading, security, and object management · Multiple distinct POAs in a single server with different policies and namespaces

For more detail on the POA, please see the specification.

A word on multithreading. Each POA has a threading policy that determines how that particular POA instance will deal with multiple simultaneous requests. In the single thread model, all requests are processed one at a time. The underlying object implementations can therefore be lazy and thread-unsafe. Of course, this can lead to performance problems. In the alternate ORB-controlled model, the ORB is responsible for creating and allocating threads and sending requests in to the object implementations efficiently. The programmer doesn't need to worry about thread management issues; however, the programmer definitely has to make sure the objects are all thread-safe.

802 CORBAExplain the CORBA architecture. Discuss the advantages of the

8

© vinod vaze

Page 100: Vaze's QB on IT

QB on IT for TY BSc. (IT)

applications built using Common Object Request BrokerArchitecture (October 2005)

Ans: -

CORBA Architecture

CORBA defines an architecture for distributed objects. The basic CORBA paradigm is that of a request for services of a distributed object. Everything else defined by the OMG is in terms of this basic paradigm. The services that an object provides are given by its interface. Interfaces are defined in OMG's Interface Definition Language (IDL). Distributed objects are identified by object references, which are typed by IDL interfaces.

The figure below graphically depicts a request. A client holds an object reference to a distributed object. The object reference is typed by an interface. In the figure below the object reference is typed by the Rabbit interface. The Object Request Broker, or ORB, delivers the request to the object and returns any results to the client. In the figure, a jump request returns an object reference typed by the AnotherObject interface.

Object Request BrokerArchitecture:-The Object Request Broker (ORB) is the CORBA software product that is used when constructing distributed application components. The ORB’s primary responsibility is to facilitate the creation and transmission of request and reply messages that occur between clients and object.

803 CORBAEnumerate the benefits of distributed applications built using CORBA Architecture (May 2004)

Ans:-

Distributed Applications

CORBA products provide a framework for the development and execution of distributed applications. But why would one want to develop a distributed application in the first place? As you will see later, distribution introduces a whole new set of difficult issues. However, sometimes there is no choice; some applications by their very nature are distributed across multiple computers because of one or more of the following reasons:

· The data used by the application are distributed

8

© vinod vaze

Page 101: Vaze's QB on IT

QB on IT for TY BSc. (IT)

· The computation is distributed · The users of the application are distributed

Data are Distributed

Some applications must execute on multiple computers because the data that the application must access exist on multiple computers for administrative and ownership reasons. The owner may permit the data to be accessed remotely but not stored locally. Or perhaps the data cannot be co-located and must exist on multiple heterogeneous systems for historical reasons.

Computation is Distributed

Some applications execute on multiple computers in order to take advantage of multiple processors computing in parallel to solve some problem. Other applications may execute on multiple computers in order to take advantage of some unique feature of a particular system. Distributed applications can take advantage of the scalability and heterogeneity of the distributed system.

Users are Distributed

Some applications execute on multiple computers because users of the application communicate and interact with each other via the application. Each user executes a piece of the distributed application on his or her computer, and shared objects, typically execute on one or more servers. A typical architecture for this kind of application is illustrated below.

Prior to designing a distributed application, it is essential to understand some of the fundamental realities of the distributed system on which it will execute.

804 CORBA

805 CORBA

806 CORBA

900 Wireless LAN

© vinod vaze

Page 102: Vaze's QB on IT

QB on IT for TY BSc. (IT)

901 What are the Restrictions and potential problems with WLAN?

Ans:

Radio signal interference

Radio signal interference in WLAN systems can go two ways: The WLAN can cause interference to other devices operating in or near it’s frequency band. Or conversely, other devices can interfere with WLAN operation, provided their signal is stronger. The result is a scrambled signal, which of course prevents the nodes from exchanging information between each other or access points. WLANs using infrared technology generally experience line-of-sight problems. An object blocking this line between the two WLAN units is very likely to interrupt the transmission of data.

Connection problem

TCP/IP provides reliable connection over wired LANs, but in WLAN it is susceptible to losing connections, especially when the terminal is operating within the marginal WLAN coverage. Another connection related issue is IP addressing. The wireless terminals can roam between access points in the same IP subnet but connections are lost if the terminal moves from one IP subnet to another.

Network security

This is an important aspect in WLAN. It is difficult to restrict access to a WLAN physically, because radio signals can propagate outside the intended coverage of a specific WLAN, for example an office building. Some security measures against the problem are using encryption, access control lists on the access points and network identifier codes. The technical operation of WLANs also works against the intruder: Frequency hopping and direct sequence operation makes eavesdropping impossible for everyone else than the most sophisticated.

902 Explain data transfer in WLAN using Infrared technology

Ans.:

DEFINITON: -Wireless LAN stands for Wireless Local Area Network. It is a flexible data communications system implemented to extend or substitute for, a wired LAN. Radio frequency (RF) technology is used by a wireless LAN to transmit and receive data over the air, minimizing the need for wired connections. A WLAN enables data connectivity and user

© vinod vaze

Page 103: Vaze's QB on IT

QB on IT for TY BSc. (IT)

mobility.

WORKING OF WLAN

1. WLANs use radio, infrared and microwave transmission to transmit data from one point to another without cables.

2. Therefore WLAN offers way to build a Local Area Network without cables. This WLAN can then be attached to an already existing larger network, EX:INTERNET

3. A wireless LAN consists of nodes and access points. A node is a computer or a peripheral (such as a printer) that has a network adapter, in WLANs case with an antenna. Access points function as transmitters and receivers between the nodes themselves or between the nodes and another network.

WLAN data transfer in itself is implemented by one of the following technologies:

1. Frequency Hopping Spread Spectrum (FHSS) 2. Direct Sequence Spread Spectrum (DSSS)

4. Infrared (IR)

DATA TRANSFER IN WLAN USING INFRARED:-

1. Infrared (IR) systems use very high frequencies, just below visible light in the electromagnetic spectrum, to carry data.

2. Like light, IR cannot penetrate opaque objects; it is either directed (line-of-sight) or diffuse technology.

3. Inexpensive directed systems provide very limited range (3 ft) and are occasionally used in specific WLAN applications.

4. High performance directed IR is impractical for mobile users and is therefore used only to implement fixed subnetworks.

Diffuse (or reflective) IR WLAN systems do not require line-of-sight, but cells are limited to individual rooms.

903 Enumerate the benefits of Wireless LAN (November 2004) & (May 2005)

The popularity of wireless LANs is a testament primarily to their convenience, cost efficiency, and ease of integration with other networks and network components. The majority of computers sold to consumers today come pre-equipped with all necessary wireless LAN technology.

© vinod vaze

Page 104: Vaze's QB on IT

QB on IT for TY BSc. (IT)

The benefits of wireless LANs include:

1. Convenience: The wireless nature of such networks allows users to access network resources from nearly any convenient location within their primary networking environment (home or office). With the increasing saturation of laptop-style computers, this is particularly relevant.

2. Mobility: With the emergence of public wireless networks, users can access the internet even outside their normal work environment. Most chain coffee shops, for example, offer their customers a wireless connection to the internet at little or no cost.

3. Productivity: Users connected to a wireless network can maintain a nearly constant affiliation with their desired network as they move from place to place. For a business, this implies that an employee can potentially be more productive as his or her work can be accomplished from any convenient location.

4. Deployment: Initial setup of an infrastructure-based wireless network requires little more than a single access point. Wired networks, on the other hand, have the additional cost and complexity of actual physical cables being run to numerous locations (which can even be impossible for hard-to-reach locations within a building).

5. Expandability: Wireless networks can serve a suddenly-increased number of clients with the existing equipment. In a wired network, additional clients would require additional wiring.

6. Cost: Wireless networking hardware is at worst a modest increase from wired counterparts. This potentially increased cost is almost always more than outweighed by the savings in cost and labor associated to running physical cables.

904 What are the components necessary for implementing WLAN? Explain. (May 2004)

Ans :

Components necessary for a WLANThe list of components necessary for a WLAN is surprisingly short. Only wireless network interface cards and access points are needed for communication to take place.

Wireless NIC: It performs the same functions as a wired NIC with one major

exception: there is no port for a twisted pair wire or coax cable

© vinod vaze

Page 105: Vaze's QB on IT

QB on IT for TY BSc. (IT)

connection to the network. Instead, in its place is an antenna to send and receive radio frequency signals.

Access Points (AP): It is a device that contains a radio transceiver (to send and receive signals) along with an RJ45 wired network interface, which allows it to connect by cable to a standard wired network. An access point has two basic functions. First, the access point acts as the base station for the wireless network. All the devices that have a wireless NIC transmit to the AP, which in turn redirects the signal to the other wireless devices. The second function of an AP is to act as a link between the wireless and wired networks. The AP can be connected to the standard network by a cable, allowing the wireless devices to access the network data. The range of an access point acting as the base station is approximately 115 meters (375 feet) in a typical office environment. The number of users a signal access point can support varies, but is generally over 100.

905 State and explain the uses of WLAN. (May 2004)

Ans :

Uses of WLAN

Hospital applications using wireless LAN capable handheld or notebook computers deliver patient information instantly and securely to doctors and nurses.

Small workgroups and audit teams can increase productivity due to quick network setup.

Students, professors, and staff at universities, corporate training centers, and other schools can access the Internet, the college catalog, and actual course content.

Network managers can use wireless LANs to reduce the overhead caused by moves, extensions to networks, and other changes.

Installing networked computers in older buildings becomes easier by using wireless LAN as a cost effective network infrastructure solution

Preconfigured wireless LAN setups need no local computer support and make trade show and branch office setups simple.

Wireless LAN in warehouses can be used to retrieve and updated information on centralized databases, thereby increasing productivity.

Network managers, senior executives, and line managers can make quicker decisions because they have real-time information at their fingertips

© vinod vaze

Page 106: Vaze's QB on IT

QB on IT for TY BSc. (IT)

906 Compare wired LAN and wireless LAN (May 2004)

Ans :Wired LAN Wireless LAN

1 Wired LAN doesn’t provide mobility.

Wireless LAN provides mobility.

2 Range of coverage is less. Range of coverage is more.3 Not easy to Use. Easy to use4 Installation speed is less Installation speed is more.5 Simplicity is less Simplicity is more6 Less Flexible More Flexible.7 Scalability is less. Scalability is more.

907 Explain the setup of Adhoc network. (May 2004)

Ans :

Adhoc network (Distributed control):

The Adhoc network (also called peer-to-peer mode) is simply a set of WLAN wireless stations that communicate directly with one another without using access point or any connection to the wired network. For example, this adhoc network can be formed by two laptops with a network interface card. There is no central controller; mobile terminals can communicate using peer-to-peer connections with other terminals independently. The network may still include a gateway node to create an interface with a fixed network. As an example this kind of setups might be very useful in a meeting where employees bring laptop computers together to communicate and share information even when the network is not provided by the company. Or an adhoc network could be set up in a hotel room or in the airport or where the access to the wired network is barred.

908 What are the different technologies in which the data transfer of WLAN Implemented? Explain any one. (November 2004)

Ans:

The technologies used are: Bluetooth Wireless LAN (IEEE 802.11b)

© vinod vaze

Page 107: Vaze's QB on IT

QB on IT for TY BSc. (IT)

IrDA (Infra Red Data Association Standard) HomeRF (Home Radio Frequency)

Bluetooth:Bluetooth is a short range radio technology that allow virtually any digital devices telecommunications, personal computing, networking, automotive, consumer electronic to communicate without wrestling with numerous cords or cables. It employs radio frequencies in the 2.42.5GHzband – the so called industrial, scientific, and medical (ISM) band, which is open for public use. The hardware required for Bluetooth is very small in size and power consumption. This comes with different interfaces, like a PCMCIA card, USB connector (in which case it is called Wireless USB). Hence it is easy to connect to any Table PC.

Features of Bluetooth:Speed: 721 MbpsScalability: Easy to expand and includes new devicesFlexibility: Instant network, conference anywhere.Security: Identification for each Bluetooth device is unique.Low cost of Ownership: No wires, lower cost

The first generation of the technology delivers performance up to 1 Mbps with data transfer rate at around 721 Kbps. Subsequent versions may carry anywhere from 2 Mbps to 12 Mbps of throughput. Bluetooth does not require a line-of-sight to work.

Therefore, a Bluetooth mobile phone can link to a laptop while the later device is sitting in a briefcase.

Bluetooth is meant for use in a PAN (Personal Area Network) standard – to connect peripherals to a computer. The distances covered are 10100m depending on the version. It is more useful in the case of self-detecting devices that move in and out of range.

Advantages of Bluetooth: Low power consumption. Secure, as each Bluetooth product has a unique identification. Flexible in adding new devices, hence good for later additions to

the system. Does not require lineofsight. Low cost.

Disadvantages of Bluetooth: Low speed for our application. Need to develop interface to browser from port. Not widely used with PC to PC communication.

© vinod vaze

Page 108: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Difficult to develop and deploy.

IrDA:IrDA is a standard defined by the Infrared Data Association. It specifies a way totransfer data using infrared radiation. The IrDA specifications include standards for boththe physical devices and the protocols they use to communicate with each other.IrDA devices communicate using infrared LED’s. Wavelength used is 875 mm +or – production tolerance (around 30 nm). The best speed for IrDA v 1,0 are in the rangeof range from 2.4 to 115.2 Kbps.

Features:Speed: 115.2 kbps, diffused IrDA gives lower speed.Scalability: Cannot scale easily to communicate with multiple hosts.Flexibility: Instant network, conference anywhere.Security: Lineofsight(also diffused), cannot penetrate walls.Low cost of Ownership: No wires, lower cost.The main attraction of IrDA is that it remains within the walls of the dentist’s office and hence is more secure. The main requirement here is to have diffused IrDA, in order to use it in our application. There are very few diffused IrDA products in the market and diffusion further reduces the speed supported.

Advantages: Secure, does not penetrate walls. Can easily communicate with peripheral devices, like printers. Low cost and can be used to transfer information from the Tablet

PC to another PC

Disadvantages: Low speed. Line-of-sight required, diffused IrDA available, but not very popular. Very small range of coverage. Generally used for communication with peripherals and not for

networking PCs.

909 What are the restrictions and potential problems with WLAN (November 2004) & (May 2005)

Ans :

© vinod vaze

Page 109: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Radio signal interferenceRadio signal interference in WLAN systems can go two ways: The WLAN can cause interference to other devices operating in or near it’s frequency band. Or conversely, other devices can interfere with WLAN operation, provided their signal is stronger. The result is a scrambled signal, which of course prevents the nodes from exchanging information between each other or access points. WLANs using infrared technology generally experience line-of-sight problems. An object blocking this line between the two WLAN units is very likely to interrupt the transmission of data.

Connection problemTCP/IP provides reliable connection over wired LANs, but in WLAN it is susceptible to losing connections, especially when the terminal is operating within the marginal WLAN coverage. Another connection related issue is IP addressing. The wireless terminals can roam between access points in the same IP subnet but connections are lost if the terminal moves from one IP subnet to another.

Network securityThis is an important aspect in WLAN. It is difficult to restrict access to a WLAN physically, because radio signals can propagate outside the intended coverage of a specific WLAN, for example an office building. Some security measures against the problem are using encryption, access control lists on the access points and network identifier codes. The technical operation of WLANs also works against the intruder: Frequency hopping and direct sequence operation makes eavesdropping impossible for everyone else than the most sophisticated.

910 Explain data transfer in WLAN using Infrared technology (November 2004)

Ans : Infrared (IR) systems use very high frequencies, just below visible light in the electromagnetic spectrum, to carry data. Like light, IR cannot penetrate opaque objects; it is either directed (line-of-sight) or diffuse technology. Inexpensive directed systems provide very limited range (3 ft) and are occasionally used in specific WLAN applications. High performance directed IR is impractical for mobile users and is therefore used only to implement fixed sub-networks.

Diffuse (or reflective) IR WLAN systems do not require line-of-sight,but cells are limited to individual rooms.

Wireless infrared transmits data using infrared (IR) light, IR shares many

© vinod vaze

Page 110: Vaze's QB on IT

QB on IT for TY BSc. (IT)

of the same properties as visible light: It travels in straight lines, and it does not penetrate physical objects such as walls and ceilings. Because the availability of infrared light is limitless, data transmission using IR do not have to be regulated like that of other wireless technologies. Another advantage of infrared is that it is secure. Because IR does not penetrate through walls, the signals stays confined inside the room and eliminatesunauthorized eavesdropping. Also, the components needed or infrared transmissions are small and consume little power.

Infrared wireless transmission can be either directed or diffused. A directed transmission requires that the emitter and detector be aimed directly at one another. The emitter sends a narrowly focused beam of infrared light to the detector, which has a small receiving or viewing area. Directed infrared is commonly used in WANs.

A diffused transmission, on other hand, relies on reflected light. Emitters on diffused infrared transmission have a wide focused beam that is pointed at the ceiling of a room and uses it as the reflection point. When the emitter transmits an infrared signal, it bounces off the ceiling and fills the room with t he signal. The detectors are also pointed at the same reflection point and can detect the reflected signal. LANs typically use diffused infrared transmission.

911 Explain the setup of Infrastructure LAN. (May 2005)

Ans :

Setup of Infrastructure LAN

The infrastructure LAN network consists of an arbitrary number of mobile terminals in addition to access points. The access points are located between mobile terminals and the fixed network. All data transmission is controlled and conveyed by the access points and they are also responsible for sharing resources between terminals. The range of an access point using radio frequencies is roughly 100 meters. The range varies widely with the geometry and other physical properties of the space in which it is used.

912 Explain the different technologies to implement data transfer in case of WLAN. (May 2005)

Ans : WLAN data transfer in itself is implemented by one of the following technologies:

© vinod vaze

Page 111: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Frequency Hopping Spread Spectrum (FHSS) Direct Sequence Spread Spectrum (DSSS) Infrared (IR)

Frequency Hopping Spread Spectrum (FHSS)Frequency Hopping Spread Spectrum (FHSS) uses a narrowband carrier that changes frequency in a pattern known to both transmitter and receiver. Properly synchronized, the net reflect is to maintain a single logical channel. To an unintended receiver, FHSS appears to be short duration impulse noise.

Frequency hopping is the simpler of two spread-spectrum techniques. Afrequency synthesizer is used to generate a carrier in the ordinary way. There is one difference, however: instead of operating at a fixed frequency, the synthesizer changes frequency many times per second according to a preprogrammed sequence of channels.

This sequence is known as a pseudorandom noise (PN) sequence because, to an outside observer who has not been given the sequence, the transmitted frequency appears to hop about in a completely random and unpredictable fashion. In reality, the sequence is not random at all, and a receiver which has been programmed with the same sequence caneasily follow the transmitter as it hops and the message can be decode normally.

Since the frequency hopping signal typically spends only a few milliseconds or less on each channel, any interference to it from a signal on that frequency will be of short duration. If an analog modulation scheme is used for voice, the interference will appear as a click and may pass unnoticed. If the spread-spectrum signal is modulated using digital techniques, an error-correcting code can be employed that will allow these brief interruptions in the received signal to be ignored, and the user will probably not experience any signal degradation at all. Thus reliable communication can be achieved in spite of interference.

Direct Sequence Spread Systems (DSSS)

The direct sequence form of spread spectrum communication is commonly used with digital modulation schemes. The idea is to modulate the transmitter with a bit stream consisting of pseudorandom noise (PN) that has a much higher rate than the actual data to be communicated. The term pseudorandom means that the bit stream appears at first glance to be a random sequence of zeros and ones but is actually generated in such a way as to repeat exactly from time to time. The data to be transmitted is combined with the PN. One common technique is to invert

© vinod vaze

Page 112: Vaze's QB on IT

QB on IT for TY BSc. (IT)

all the bits of the PN stream during the time the “real” data is represented by a one and to leave the PN bit stream unchanged when a data zero is to be transmitted. The extra bits transmitted in this way are called chips, and resulting bit rate is known as the chipping rate. Most direct-sequence

Spread-spectrum systems use a chipping rate at least ten times as great as the bit rate of the actual information to be transmitted. The use of the high speed PN sequence results in an increase in the bandwidth of the signal, regardless of what modulation scheme is used to encode the bits into the signal. For any given modulation scheme, the bandwidth is proportional to the bit rate. It follows from Hartley’s Law that a direct-sequence system transmitting a total of ten bits for each information bit will use ten times as much bandwidth as a narrowband signal with the same type of modulation and the same information rate. That is, the sideband will expand ten times as far from the carrier. Direct-sequence spread-spectrum scheme typically use some form of phase shift keying (PSK).

Infrared (IR)Infrared (IR) systems use very high frequencies, just below visible light in the electromagnetic spectrum, to carry data. Like light, IR cannot penetrate opaque objects; it is either directed (line-of-sight) or diffuse technology. Inexpensive directed systems provide very limited range (3 ft) and are occasionally used in specific WLAN applications. High performance directed IR is impractical for mobile users and is therefore used only to implement fixed subnet-works.Diffuse (or reflective) IR WLAN systems do not require line-of-sight,but cells are limited to individual rooms.

Wireless infrared transmits data using infrared (IR) light, IR shares many of the same properties as visible light: It travels in straight lines, and it does not penetrate physical objects such as walls and ceilings. Because the availability of infrared light is limitless, data transmission using IR do not have to be regulated like that of other wireless technologies. Another advantage of infrared is that it is secure. Because IR does not penetrate through walls, the signals stays confined inside the room and eliminates unauthorized eavesdropping. Also, the components needed or infrared transmission are small and consume little power.

Infrared wireless transmission can be either directed or diffused. A directed transmission requires that the emitter and detector be aimed directly at one another. The emitter sends a narrowly focused beam of infrared light to the detector, which has a small receiving or viewing area. Directed infrared is commonly used in WANs.

A diffused transmission, on other hand, relies on reflected light.

© vinod vaze

Page 113: Vaze's QB on IT

QB on IT for TY BSc. (IT)

Emitters on diffused infrared transmission have a wide-focused beam that is pointed at the ceiling of a room and uses it as the reflection point. When the emitter transmits an infrared signal, it bounces off the ceiling and fills the room with t he signal. The detectors are also pointed at the same reflection point and can detect the reflected signal. LANs typically usediffused infrared transmission.

913 What are the different Wireless LAN standards? Compare the Standards based on their Application frequency range and Data rate. (October 2005)

Ans :

In July 1997, the IEEE published a standard for Wireless LAN. This standard is named 802.11, and in September 1999, they ratified the 802.11b (High rate) to the standard.

IEEE 802.11 (FHSS) Frequency Hopping Spread SpectrumIEEE 802.11 (DSSS) Direct Sequence Spread SpectrumIEEE 802.11 (Infrared) ( 800 to 950 nm)IEEE 802.11a (OFDM) Orthogonal Frequency Division MultiplexingIEEE 802.11b HR DSSS) High Rate DSSSIEEE 802 (g) (OFDM) Achieves 22 or even 54 Mbps

Application Wireless Ethernet Wireless AATM Wireless Ethernet

IEEE Technique Band ModulationData Rate

(Mbps)

802.11FHSS 2.4 GHz FSK 1 and 2DSSS 2.4 GHz PSK 1 and 2

Infrared PPM 1 and 2

802.11 (a) OFDM 5.725 GHzPSK or QAM

6 to 54

802.11 (b) DSSS-HR 2.4 GHz PSK /CCK 5.5 and 11802.11(g) OFDM 2.4 GHz Different 22 and 54

FSK: Frequency Shift KeyingPSK: Phase Shift KeyingQAM: Quadrature Amplitude ModulationPPM: Pulse Position ModulationCCK: Complementary Code KeyingISM: Industrial Scientific and Medical

© vinod vaze

Page 114: Vaze's QB on IT

QB on IT for TY BSc. (IT)

914 Discuss the security issues with wireless network (October 2005) & (May 2006)

Ans :

Network securityThis is an important aspect in WLAN because it is different than the wired LAN & difficult to control. It is difficult to restrict access to a WLAN physically, because radio signals can propagate outside the intended coverage of a specific WLAN, for example an office building / college.

Desired Security Services:1. Message confidentiality2. Message Integrity3. Message Authentication4. Message Non-repudiation and5. Entity Authentication

Some security remedial measures against the problem are:1. using encryption, 2. access control lists (ACL) on the access points (AP) and 3. Network identifier codes.

The technical operation of WLANs also works against the intruder:

Ways to achieve these services:

1. FHSS: Frequency Hopping Spread Spectrum and2. DSSS: Direct Sequence Spread Spectrum

Frequency Hopping and Direct Sequence operation makes eavesdropping impossible for everyone else, other than the authenticated.

In FHSS: The intruder does not know the spreading sequence thus he cannot make any sense of the data. He gets only noise.

In DHSS: Since each bit is spread by a unique code, (The famous Barker sequence) the intruder does not know the code. Thus spread signal can also provide Privacy.

Wireless Application Protocol (WAP) Security:

WAP is a communication protocol that enables wireless mobile devices to have an access to the Internet.

WAP architecture includes a WAP Gateway between the client and

© vinod vaze

Page 115: Vaze's QB on IT

QB on IT for TY BSc. (IT)

the server. Security Layer (also called Wireless Transport Layer Security

(WTLS) Protocol). When present provides features of:

1. Server Authentication2. Client Authentication3. Privacy 4. Secure Connection – as required by many modern e-commerce

and m-commerce applications and5. Data Integrity

Similar services can be achieved by SSL; However SSL needs reliable transport layer. Whereas WTLS doesn’t require a reliable transport layer. WTLS defines a sequence number field in the frame which is not the case of SSL.(Secure Socket Layer)

915 What is the range of coverage of wireless LAN? What can cause the interference in coverage? Explain (October 2005)

Ans :

Range of coverageThe distance over which RF and IR waves can communicate depends on product design (including transmitted power and receiver design) and the propagation path, especially in indoor environments. Interactions with typical building objects, such as walls, metal, and even people, can affect the propagation of energy, and thus also the range and coverage of the system. IR is blocked by solid objects, which provides additional limitations. Most wireless LAN systems use RF, because radio waves can penetrate many indoor walls and surfaces. The range of a typical WLAN node is about 100 m. Coverage can be extended, and true freedom of mobility achieved via roaming.

This means using access points to cover an area in such a way that their coverage’s overlap each other. Thereby the user can wander around and move from the coverage area of one access point to another without even knowing he has, and at the same time seamlessly maintain the connection between his node and an access point.

916Direct Sequence Spread Spectrum (DSS) generates a redundant bit pattern for each bit to be transmitted. This bit pattern is called a chip (or chipping code). The longer the chip, the greater the probability that the original data can be recovered (the more bandwidth requires also). Even if one or more bits in the chip are damages during transmission, statistical techniques can recover the original data without the need for

© vinod vaze

Page 116: Vaze's QB on IT

QB on IT for TY BSc. (IT)

retransmission. To an unintended receiver, DSSS appears as low-power, wide-band noise and is ignored by most narrowband receivers. The type of receiver for spread-spectrum reception depends on how the signal is generated.

For frequency-hopped transmission what is needed is a relatively conventional narrowband receiver that hops in the same way as and is synchronized with the transmitter. This requires that the receiver be given the frequency-hopping-sequence, and there be some form of synchronizing signal (such as the signal usually sent at the start of a data frame in digital communication) to keep the transmitter and receiver synchronized.

Some means must also be provided to allow the receiver to detect the start of a transmission, since, if this is left to chance, the transmitter and receiver will most likely be on different frequencies when a transmission begins.

One way to synchronize the transmitter and receiver is to have the transmitter send a tone on a prearrange channel at the start of each transmission, before it begins hopping. The receiver can synchronize by detecting the end of the tone and then begin hopping according to the prearranged PN sequence. Of course, this method fails if there happens to be an interfering signal on the designated synchronizing channel at the time synchronization is attempted.

A more reliable method of synchronizing frequency-hopping systems is for the transmitter to visit several channels in a prearranged order before beginning a normal transmission. The receiver can monitor all of these channels sequentially, and once it detects the transmission, it can sample the next channel in the sequence for verification and synchronization.

Direct-sequence-spread-spectrum transmission requires different reception techniques. Narrowband receivers will not work with these signals, which occupy a wide bandwidth on a continuous basis. A wideband receiver is required, but a conventional wideband receiver would output only noise. In order to distinguish the desired signal, a technique called autocorrelation is used. Essentially this involves multiplying the received signal by a signal generated at the receiver fro the PN code. When the input signal corresponding to the PN code, the output from the auto-correlator will be large; at other times this output will be very small.

Of course, once again the transmitter and receiver will probably not be synchronized at the start of a transmission, so the transmitter sends a preamble signal, which is a prearranged sequence of ones and zeros, to

© vinod vaze

Page 117: Vaze's QB on IT

QB on IT for TY BSc. (IT)

let the receiver synchronize with the transmitter.

+ Bits 0–3

4–7 8–15 16–18

19–31

0 Version

Header

length

Type of Service(now DiffServ

and ECN)

Total Length

32 Identification Flags

Fragment Offset

64 Time to Live Protocol Header Checksum96 Source Address

128 Destination Address

© vinod vaze

Page 118: Vaze's QB on IT

QB on IT for TY BSc. (IT)

160 Options160or

192+

Data

© vinod vaze