Assignment#4 with solution

advertisement
Sarajevo School of Science and Technology
Course: IS335, spring 2006.
Assignment #4: Due Wednesday June 07, 2006, 9:00 AM.
Please accommodate your answers in the space below the question.
Question 1: A simple transport protocol, chapter 6.3.
a. What is the Transport entity? (5 points)
Transport entity is software collection of functions called by application.
b. What is called TSAP? (5 points)
It is equivalent to ports.
c. What is called NSAP? (5 points)
NSAP is equivalent to IP address.
d. List service primitives with their arguments and returns and messages
(packet types)? (5 points)
connum = LISTEN(local)
connum = CONNECT(local, remote)
status = SEND(connum, buffer, bytes)
status = RECEIVE(connum, buffer, bytes)
status = DISCONNECT(connum)
CALL_REQUEST
CALL_ACCEPT
CLEAR_REQUEST
CLEAR_CONFIRMATION
DATA
CREDIT
e. Who is calling service primitives? (5 points)
Applications.
f. Assume we have three applications on each side that want to talk to each
other. Can three applications on H1 side talk to a single application on H2
side? (10 points)
No.
g. How can the applications talk to each other? (5 points)
1
Pairwise.
h. If application on H1 side wants to send two messages to the application on
H2 side, write the sequence of application calls on H1 side and H2 side.
(10 points)
H1:
cid = CONNECT(loc1, rem1)
H2:
cid = LISTEN(rem1)
ok = RECEIVE(cid, buffer, bytes)
ok = SEND(cid, buffer, bytes)
ok = RECEIVE(cid, buffer, bytes)
ok = SEND(cid, buffer, bytes)
ok = DISCONNECT(cid)
ok = DISCONNECT(cid)
i. Which primitive is determining connection id? (5 points)
cid = CONNECT
j. What will happen (on H1 and on H2 side) if H1 application is waiting for
credit and corresponding application disconnects? (10 points)
Application will get back ERR_CLOSED
k. What will happen (on H1 and on H2 side) if H2 waits for data and H1
disconnects? (10 points)
Application will get back ERR_CLOSED.
Question 2: Consider two LANs connected by Internet (cloud) on Fig below.
Router
Router
Internet
200.100.100.161/28
LAN1
LAN2
204.103.102.65/26
204.103.102.66/26
200.100.100.162/28
H2
H1
a. What is the IP address of LAN1 and LAN2? (5 points)
200.100.100.160
and
204.103.102.64
2
b. If Ethernet address of the H1 = 00 00 C0 A0 51 24 (hex), and LAN1 router =
00 00 A1 B2 21 54 (hex), outline the complete maximum data packet with
Ethernet/IP/TCP headers without optional fields, that H1 sends to H2 and fill
in and explain all relevant fields. Use the standard TCP/IP format (4 bytes
per row) and mark fields in hex numbers or binary as appropriate.
c. (20 points)
preamble
preamble
preamble
Destination = 00 00
Address = A1 B2 21 54
Source = 00 00 C0 A0
Address 51 24
type=0800
IHL=5
4
TOS
total length = 1500
Packet ID
df mf fragm offset
ttl
Protocol=6
IP hdr chcksum
IP source address = 200.100.100.162
IP destination address = 204.103.102.66
IP options
source port
dest port
seq number (first byte)
ack number (expected byte)
window size
TCP checksum
urgent ptr
options
Ethernet
header
IP header
TCP header
Data
ethernet chacksum
3
Download