Documente Academic
Documente Profesional
Documente Cultură
(IT)
Question Bank
on
Internet Technology
© vinod vaze
QB on IT for TY BSc. (IT)
801 CORBA
© vinod vaze
QB on IT for TY BSc. (IT)
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.
© vinod vaze
QB on IT for TY BSc. (IT)
Identification :
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
© vinod vaze
QB on IT for TY BSc. (IT)
value of 0.
Example :
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.
Slow Start
1. 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 Increase
a) 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.
© vinod vaze
QB on IT for TY BSc. (IT)
Multiplicative Decrease
a) If congestion occurs, the congestion window size must be
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 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
TCP client can attain.
Ans:
State Description
CLOSED There is no connection
LISTEN Passive open received; waiting for SYN
SYN-SENT SYN sent; waiting for ACK
SYN-RCVD SYN+ACK sent; waiting for ACK
EATABLISHED Connection established; data transfer in progress
FIN-WAIT-1 First FIN sent; waiting for ACK
FIN-WAIT-2 ACK to first FIN received; waiting for second FIN
© vinod vaze
QB on IT for TY BSc. (IT)
Ans:
© vinod vaze
QB on IT for TY BSc. (IT)
timers—
retransmission,
persistence,
keep-alive, and
time-waited — in
its operation.
13 Preference & TCP is preferred • UDP is preferred &
Use & used for: Used for one-shot,
reliable, byte- client-server type
stream delivery request-reply queries,
between Example: DNS
processes. • 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 & The TCP header The UDP header is much
Overheads: is much larger smaller than the TCP
than the UDP header
header
15 Example of TELNET DNS
application
16 Connection Required to have No prior connection at
explicit all: It is connectionless
connection
between the
hosts.
Three Way
Handshake
17 Latest trends Use SCTP [ Stream Control Transmission
Protocol] which combines the good features
of both TCP and UDP
© vinod vaze
QB on IT for TY BSc. (IT)
Ans:
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.
The total length field defines the total length of the datagram including the
header.
© vinod vaze
QB on IT for TY BSc. (IT)
Ans:
007 Ans:
TCP TIMERS
Timers
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:
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
© vinod vaze
QB on IT for TY BSc. (IT)
Ans:
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:
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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:
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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.
Ans:
© vinod vaze
QB on IT for TY BSc. (IT)
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.
© vinod vaze
QB on IT for TY BSc. (IT)
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
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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.
© vinod vaze
QB on IT for TY BSc. (IT)
011 Draw the IP packet format and explain each of its fields.
Which fields of the IP header change from router to router?
Ans:
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.
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.
012 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.
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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.
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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.
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
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.
Header
© vinod vaze
QB on IT for TY BSc. (IT)
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:
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
© vinod vaze
QB on IT for TY BSc. (IT)
© vinod vaze
QB on IT for TY BSc. (IT)
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
© vinod vaze
QB on IT for TY BSc. (IT)
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
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:
© vinod vaze
QB on IT for TY BSc. (IT)
Ans:
i) The source port number is: 1330
ii) The destination port number is: 23
iii) The sequence number is: 1
iv) The acknowledgement number is: 0
v) The length of the header is: 5 x 4 = 20 bytes
vi) The type of segment is: The synchronize bit is set. Hence it is
synchronize segment.
vii) The size of window is: 511
4500 00 54 00 03 00 00 20 06 00 00 7C 4E 03 02 B4 0E 0F 02
Ans.
© vinod vaze
QB on IT for TY BSc. (IT)
Flags 3 0 000
Fragmentatio 13 00 00000000
n Offset
Time to Live 8 20 0010 0000
Protocol 8 06 0000 0110
Header 16 0000 00000000 00000000
Checksum
S. No Question Answer
1. Classify the above header Version IPv4
© vinod vaze
QB on IT for TY BSc. (IT)
Ans.
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
© vinod vaze
QB on IT for TY BSc. (IT)
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
QB on IT for TY BSc. (IT)
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
QB on IT for TY BSc. (IT)
Ans.
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.
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 :
© vinod vaze
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
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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
Identification
This field holds a number that is a unique identifier created by the sending
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
© vinod vaze
QB on IT for TY BSc. (IT)
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
header
Field (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.
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
© vinod vaze
QB on IT for TY BSc. (IT)
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 is
usually 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
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
© vinod vaze
QB on IT for TY BSc. (IT)
022 Explain the three way hand shake method for TCP 8
connection
Establishment?
Ans :
Three-way handshaking:
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
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 has
a 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
acknowledges
The receipts of the second segment sign the ACK flag and
© vinod vaze
QB on IT for TY BSc. (IT)
© vinod vaze
QB on IT for TY BSc. (IT)
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.
024 Draw the TCP state transition diagram. Explain the states, which the 8
TCP client can attain?
Ans :
© vinod vaze
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 .
• · ESTABLISHED represents an open connection, data received can
be delivered
• To the user. The normal state for the data transfer phase of the
© vinod vaze
QB on IT for TY BSc. (IT)
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 .
Ans:
Karn’s Algorithm:
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.
© vinod vaze
QB on IT for TY BSc. (IT)
026 What are the syndromes created by TCP sender and receiver? How 4
can these be prevented?
The solution is to prevent sending TCP from sending this data byte
by byte. The sending TCP must be forced to wait as it collects data to
send in a larger block. How long should the sending TCP wait? If it waits
too long, it may delay the process. If it does not wait long enough, it may
end up sending small segments. Nagle found an elegant solution.
Nagle’s Algorithm:
Nagle 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.
© vinod vaze
QB on IT for TY BSc. (IT)
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:
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.
© vinod vaze
QB on IT for TY BSc. (IT)
2) If the timer goes off before the acknowledgement arrives, the segment
is retransmitted and the timer is reset.
029
What is the state of the connection after each event? What is action
after each event?
Ans:-
• LISTEN
• SYN-SENT
• SYN-RECEIVED
• ESTABLISHED
• FIN-WAIT-1
• FIN-WAIT-2
• CLOSE-WAIT
• CLOSING
• LAST-ACK
• TIME-WAIT
• CLOSED
© vinod vaze
QB on IT for TY BSc. (IT)
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 before
State : TIME-WAIT
And once the timers expires after double the MSL time connection is
closed.
© vinod vaze
QB on IT for TY BSc. (IT)
States of TCP :
© vinod vaze
QB on IT for TY BSc. (IT)
030
031
100
ARP (Address Resolution Protocol)
101
102
103
104
105
200
RARP
(reverse Addess Resolution Protocol)
© vinod vaze
QB on IT for TY BSc. (IT)
201 With the help of a neat diagram explain the fields in Reverse Address
Resolution Protocol packet. (October 2005)
RARP packet:
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.
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.
© vinod vaze
QB on IT for TY BSc. (IT)
22 MIL-STD-188-220.
23 Metricom.
24 IEEE 1394.1995.
25 MAPOS.
26 Twinaxial.
27 EUI-64.
28 HIPARP.
Protocol Description
0x800 IP.
Opcode. 8 bits.
Ans :-
The machine can get the physical address by reading the NIC,
© vinod vaze
QB on IT for TY BSc. (IT)
203 The RARP request packets are broadcast; RARP reply packets are 4
unicast, Explain. (May 2005)
Ans :-
© vinod vaze
QB on IT for TY BSc. (IT)
A machine that has its physical address and needs to find its IP address ,
sends a RARP request to all systems on the network.
The server sends back the RARP reply packet that includes the IP
address of the requestor.
204
205
206
207
208
209
210
300
RIP (Routing Information Protocol)
302
Why does the network using routing information protocol become
301 RIP prevents routing loops from continuing indefinitely by 8
implementing a limit on the number of hops allowed in a path from the
source to a destination. The maximum number of hops in a path is 15. If a
router receives a routing update that contains a new or changed entry,
and if increasing the metric value by 1 causes the metric to be infinity (that
is, 16), the network destination is considered unreachable. The downside
of this stability feature is that it limits the maximum diameter of a RIP
network to less than 16 hops.
Preventing instability
© vinod vaze
QB on IT for TY BSc. (IT)
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 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
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
© vinod vaze
QB on IT for TY BSc. (IT)
chart shows the metric for the target network, as it appears in the routing
table at each gateway.
time ------>
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".
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".
303
304
305
306
307
308
© vinod vaze
QB on IT for TY BSc. (IT)
309
310
400
OSPF [Open Shortest Path First]
© vinod vaze
QB on IT for TY BSc. (IT)
500
BGP [Border Gateway Protocol]
Explain the Path Vector Routing. Compare it with Distance Vector
501 Routing message packet used by Border Gateway and Link State
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.
© vinod vaze
QB on IT for TY BSc. (IT)
© vinod vaze
QB on IT for TY BSc. (IT)
502 What different types of message BGP uses? Explain use of each
Message Type? (May 2005)
Ans:
Ans:
© vinod vaze
QB on IT for TY BSc. (IT)
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 sevice.
As a matter of fact, a router can hav 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.
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 8
Protocol? Explain the Border Gateway Protocol Header; explain the
fields of Open message packet. (October 2005)
© vinod vaze
QB on IT for TY BSc. (IT)
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.
© vinod vaze
QB on IT for TY BSc. (IT)
authentication information.
506 8
State the Dijkstra algorithm and explain with the help of an example
507 (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.
© vinod vaze
QB on IT for TY BSc. (IT)
508 What different types of message BGP uses? Explain use of each
Message Type? (May 2005)
Ans:
© vinod vaze
QB on IT for TY BSc. (IT)
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.
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.
© vinod vaze
QB on IT for TY BSc. (IT)
provide the exchange criteria for two BGP routers to establish a peer
relationship.
510 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.
© vinod vaze
QB on IT for TY BSc. (IT)
511
512
513
514
515
© vinod vaze
QB on IT for TY BSc. (IT)
608
Socket Programming
700
RMI Remote Method Invocation
RMI
701 Write a short note on Marshalling and Un-marshalling. (November
2004)
Ans:-
© vinod vaze
QB on IT for TY BSc. (IT)
The Task of converting the return value to the client data type is called un-
marshaling the value.
RMI
702 Write a short note on distributing and installing RMI software (May
2004)
Ans:-
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.
703 Ans:-
© vinod vaze
QB on IT for TY BSc. (IT)
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 stub and skeleton layer of RMI lie just beneath the view of the Java
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.
© vinod vaze
QB on IT for TY BSc. (IT)
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.
The stub objects use the invoke() method in RemoteRef to forward the
method call. The RemoteRef object understands the invocation semantics
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
© vinod vaze
QB on IT for TY BSc. (IT)
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.
Transport Layer
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
QB on IT for TY BSc. (IT)
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 Weblogic and NinjaRMI 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.
4
704 RMI
How does RMI overcome the issues arising due to firewalls? Explain
in detail. (November 2004)
Ans:-
Firewall Issues
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
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.
© vinod vaze
QB on IT for TY BSc. (IT)
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
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
QB on IT for TY BSc. (IT)
RMI 8
705 Write 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:-
Import java.io.*;
Import java.net.*;
Class echo Client
{
Public static viod main(String args[])
{
Int port=9999;
Socket s;
String msg=””;
Try
{
Buffer reader br=new buffered reader(new input Stream
Reader(System.in));
InetAddress
Addr=InetAddress.getByName(nul);
S=new Socket(add,port);
© vinod vaze
QB on IT for TY BSc. (IT)
Import java.io.*;
Import java.net.*;
Class case Client
{
Public static viod main(String args[])
{
Int port=9999;
Socket s;
String msg=””;
Try
{
Buffer reader br=new buffered reader(new input Stream
Reader(System.in));
InetAddress
Addr=InetAddress.getByName(nul);
S=new Socket(add,port);
© vinod vaze
QB on IT for TY BSc. (IT)
Pe.flush();
Msg=br1.readline();
System.out.printline(“Answer from Server”+msg);
}
}
Catch(Exception e)
{}
}
}
706 RMI
What are the different types of parameters in RMI? How are they
passed between java virtual machines? (October 2005), (May 2006)
Ans:-
Parameters in RMI
RMI
707 Explain 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
QB on IT for TY BSc. (IT)
rmiIntf.java : -
import java.rmi.*;
interface rmiIntf extends Remote
{
int add(int a, int b ) throws RemoteException;
}
rmiServerImpl.java : -
import java.rmi.*;
import java.rmi.server.*;
public class rmiServerImpl extends Unicast RemoteObject implements
rmiServerIntf
{
rmiServerImpl()throws RemoteException
{
}
Public int add(int a, int b ) throws RemoteException
{
Return a+b;
}
}
rmiServer.java : -
import java.rmi.*;
import java.net.*;
public class rmiServer
{
Public static viod main(String args[])
{
Try
{
rmiServerImpl adsi=new rmiServerImpl();
© vinod vaze
QB on IT for TY BSc. (IT)
Naming.rebind(“Server”,adsi);
}
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));
}
}
RMI 8
708 What are the components required to build a working RMI system?
(May 2006)
Ans:-
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
© vinod vaze
QB on IT for TY BSc. (IT)
will not have to set up an HTTP or FTP server to provide the class files.
(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:
709 8
800
CORBA
What is an Object Adapter as defined in CORBA specification? 8
801 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
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
© vinod vaze
QB on IT for TY BSc. (IT)
© vinod vaze
QB on IT for TY BSc. (IT)
802 CORBA
Explain the CORBA architecture. Discuss the advantages of the
applications built using Common Object Request BrokerArchitecture
(October 2005)
Ans:-
CORBA Architecture
803 8
© vinod vaze
QB on IT for TY BSc. (IT)
CORBA
Enumerate the benefits of distributed applications built using
CORBA Architecture (May 2004)
Ans:-
Distributed Applications
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.
804
© vinod vaze
QB on IT for TY BSc. (IT)
CORBA
805 CORBA
806 CORBA
900
Wireless LAN
901 What are the Restrictions and potential problems with WLAN?
Ans:
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.
© vinod vaze
QB on IT for TY BSc. (IT)
Ans.:
WORKING OF WLAN
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.
© vinod vaze
QB on IT for TY BSc. (IT)
© vinod vaze
QB on IT for TY BSc. (IT)
© vinod vaze
QB on IT for TY BSc. (IT)
26 --
Congestion Window Size (in
24 --
segments)
22 --
20 -- Time-out
18 --
Multiplicative
16 --Threshold=
14 --16
Decrease
12 -- Threshold=
10 -- 10
08 --
06 --
04 --
02 -- 1 2 3 4 5 6 7 8 9 10 11
12 13 14
Number of transmitted segments
© vinod vaze