Question : bits delivered to network layer protocol??

ok..I have a problem and I will post it below.. I have come to a variety of conclusions, but my book is extremely vague and I cannot tell if or which I am correct with.

The Question: A TCP segment consisting of 1500 bits of data and 160 bits of header is sent to the IP layer, which appends another 160 bits of header. This is then transmitted through two networks, each of which uses a 24-bit packet header. The destination network has a maximum packet size of 800 bits. How many bits, including headers, are delivered to the network layer protocol at the destination?

Answer 1: I was thinking that if the amount of bits for the headers remains constant, then wouldn't your first acount for the amount in each header (that is 160 header bits for the transport layer, 160 header bits for the IP layer, and then 2 x 24 header bits for the 2 networks) be a total of 320 + 48 = 368 bits.

The destination network has a maximum of 800 bits. 800 - 368 (for headers) = 432 bits max size for the segment.

A total of 1500 bits that need to be sent: So I divided 1500 / 432 = 3.47. So I rounded this off to 4 segments.

But I do not know where to go from here to get the amount of bits..

Answer 2: Instead of adding (2 * 24) packet header bits for each network, I only added 24 because the book says when you are routing packets between 2 networks, the "router strips the packet header off and the IP header is examined". After the packet is examined, the router "augments the packet with another network access header and directs the datagram out across the second network". This second network access header would be the second 24-bit packet header mentioned in the problem...

Instead of having a total of 368 total header bits:

I instead got (2 * 160) + 24 = 344 total header bits.

-I feel this answer may be the 'more' correct one, but I still am not sure as to how to get the total amount of bits. Am I looking too deep? Is it just this 344 + the 1500 for the data? I am really confused.

Also I have one more question and that is: Why can't a user program directly access IP?

-Is it just because IP is accessed either using TCP or UDP? Or is it a deeper answer than that?

Answer : bits delivered to network layer protocol??

160bits (40 bytes) for header is correct, but i suspect that 1500bits is a typos and they meant bytes. But the logic still the same. For a given MTU you substract enough room for the TCP and IP header (160bits), then the remaining space may be used for data.

When a packets travel from network to another, the IP header will not be added, but will replace the existing one. Also, IP header is always 20bytes, not 24. To calculate the amount of packets needed for fragmentation, you will use the MSS instead of the MTU.  MSS+TCP(20bytes)+IP(20bytes)= MTU.  Then for a 800 bytes MTU the MSS=760.  If the MTU (i never seen that) is given in bits, it will be 800-320=480bits of data per packet.
Random Solutions  
 
programming4us programming4us