Here are answers to some questions .... .
Note that the more recent answers are added at the
start .
But first two corrections to Assignment 4
The second one replaces the earlier correction (now deleted), dated 6 May
Q3 (iv) How must the routing tables be changed to connect directly
between ports 0 and 5, bypassing ports 1, 2, 3 and 4??
Q4. A user record of 4020 bytes (4000 data + 20 IP header) is
transmitted over a TCP/IPv4 link as below. (The 4000 bytes includes
any TCP header.)
There were a lot of questions about fragmentation, so I will give
a major overview of IP and hope that answers the questions.
But first of all I have made a few changes to the Web page on reassembly
as below.
IP Reassembly ("defragmentation")
These actions are performed for each received packet
- check the packet identification to select the assembly buffer
- use the offset*8 to place the fragment correctly in the assembly
buffer
- get the data_length = total_length - 4*header_length
- if this is the first copy of this fragment, add the fragment
data_length into the total received_length for the packet
- if mfb=0, calculate original_length from offset*8+data_length
- if original_length = received_length, then packet is complete
(The offset must be multiplied by 8 because it is in units of 8 octets;
similarly the header length is in units of 4 octets and is multiplied by 4.)
And now some other points --
- Assume the IP header is always 20 octets, in other words there
are no Options fields.
(As the header length is in units of
32-bit words, its value in the header will be 5.)
(While some diagrams do show the options fields, that is mainly to
show where they go, if they are included.)
- Once an IP datagram is fragmented, the fragments travel quite
independently until they are reassembled at the destination.
If fragments are further fragmented, those sub-divided pieces
also travel independently -
they are really just other datagrams
and IP routers don't worry too much about what they contain.
Fragments are united only when they reach the final destination.
Each fragment is itself an IP packet and therefore needs its
own IP header to control its own routing etc.
- The TCP header (usually 20 octets) is treated by IP as just part
of the first packet.
It has no meaning to IP and is just another sequence
of octets.
- MTU means the Maximum Transmission Unit.
While the total
packet size may be less than the MTU (and often is), it may
never be larger than the MTU.
Certainly the last fragment of a sequence may have almost any
size less than the MTU and is seldom a multiple of 8 long.
- Fragmentation usually uses a "greedy" algorithm, making each
new fragment as big as will fit into the MTU.
But if the MTU (less IP header) is not a multiple of 8
the fragment must be a little less than the MTU.
For example, if a packet of 2500 octets total
is to be sent over MTU=2000, the maximum IP payload is 1980, which
is not a multiple of 8.
The payload must be reduced to 1976 octets (=247*8), giving an
IP packet of 1996 octets.
- The 16 bit LENGTH field in the IP header is the total length
of the packet in bytes,
while the HEADER_LENGTH field is the length of the header itself,
in units of 32 bits or 4 octets.
The data length is the difference between the two (after scaling
HEADER_LENGTH to octets).
- It is only the data or payload of the IP packet or datagram
that is fragmented at each stage.
Each fragment gets its own IP header which is derived from the
original header, copying the addresses and identification
fields, etc
and inserting correct values for some others (as
in the notes).
- Remember that the IP packet has two components - the IP header
(which is used by the "system") and the IP payload (which is the
user data, and may be a TCP segment containing its own TCP
header).
Fragmentation applies only the to IP payload -- the incoming
IP header is removed, the packet is fragmented as needed, and
an appropriate IP header attached to each outgoing fragment or
packet.
I am reading the material about VC which u provide on the web.
And I am confused one thing that is:
"VC number may be
(1)shared between different links to the same router, and even
(2)in different directions over the same link, but
(3)must be unique in one direction over the one link."
Can I understand them as
(1)different ports in the same router can have same VC number (no matter it is
incoming or outgoing),
(2)In the same link, two ports can have same VC number(one's outgoing VC num is
equal to another's incoming VC num)
(3)assuming a link from router A port 1 to router B port 3, for router A port 1,
if outgoing num is 103, then the incoming num cannot be 103. And this is the
only one limitation for VC num generation.
I think my question is not so clear since I am still in the fog.
Could you please explain them?
Your questions 1 & 2, the answer is YES.
Your question 3; there is nothing to stop a port using the same VC number
for an outgoing circuit and an incoming circuit.
Another question is about link.
From the defination in the handout
"A link is a long distance connection between two routers,..."
However, can we say the case in the assignmet which is just from port 1 to port
3 in the same router is a link?
Yes, the "link" can be very short.
Third question is about Assignment4 Q3(iv).
I really cannot understand why you ask us to do this(Maybe this is due to I
cannot understand VC well)? I noticed they have the same outgoing VC nums, and
same incoming NC nums. However, to my understanding, it should not be a problem
here. Maybe:) Could you please give some hints?
It is really just a contrived example to do something with routing tables.
Perhaps in a real test like this you might have some other equipment or a real
long link between two of the loopback ports
and you want to be able to run
tests both with and without the other stuff.
On page 13 (lecture handout) *Iteration 2* the cost from A to E is 2 via node B
(B,2).The question is : Why did not we take route D ?i.e. from A to E via D, the
cost would be the same;A already knows about D.
No good reason - if two costs are the same, just choose either one.
How come an MTU of 5000 octets is bigger than the packet size of 4020 octets?
In the lecture example the MTU's (1500/820 octets) are smaller than the user
record data.
The MTU=5000 is larger than the packet and does not force fragmentation.
The lecture example was set to force fragmentation.
Q3. Am i right to assume the following ?
_|0 A |
| |
| 1|-
120 (Outgoing VC)
996 (Incoming VC)
If so how 0&1 and 4&5 have the same Outgoing & Incoming VC's of 120 and 996
respectively?
Why shouldn't they be the same?
As it is only the [port, VC] pair that matters, we can repeat VC numbers
on different ports as much as we want.
For Question 4, the question asks to give appropriate values for all
quantities concerned with fragmentation and reassembly...
what are the appropriate values ?
are you asking to show offset for each packet?
or are you asking to show the total number of bytes received ?
I am asking for all of the values needed for reassembly,
whatever they are.
This is a question from several students.
In Q 1, a node has two paths to node A, with equal costs.
Which one do we use?
This is a situation that I have mentioned before, and helps to prepare
you for the real world. The REAL WORLD is not nice and tidy, like a lot
of assignments, but often has unexpected situations where you must make
a decision, often with little guidance.
What you must do is make the best decision that you can, explain what it
is and why you have made it. At least the choice is not a mystery.
Here it is reasonable to choose the path
with fewer hops to the root node, or the path connected to node with the
lowest (or highest ID), or simply pick a path at random.
Any reasonable solution is as good as any other, but you must
explain what you have done, and give some reason, even if it is "I
made a random choice, because there seemed no good reason for any other".
For Assignment 4 Q4, "A user record of 4020 bytes is transmitted over a
TCP/IPv4 link", does it mean 4020 bytes includes 20 bytes of TCP header and
4000 bytes of user data?
You are correct.
for the last question , when I tried to find the offsets for MTU is 2000 , then
as usual I assume the IP header is 20 bytes , when I divide 1980 by 8 , I have
decimals , is it the offset correct or do I make the wrong calculation ??
The IP header is not included in the offset calculations.
When fragmenting, always take earlier fragments in blocks of 8 octets
to ensure that later offsets give integers when divided by 8.
You may end up with an odd-sized piece at the very end, but that is handled
by the length field which is in bytes and does not have to be a multiple of 8.
For question 3 of assignment 4, I want to ask that,
1)why is the VC number are the same for 2 different port?
please explain, thanks
The Virtual Circuit Number is not important by itself;
it is really the pair [port, VCnum] that matters.
So two ports can certainly share the same VC number