1
$\begingroup$

I recently started computer networks with some understanding of algorithms and discrete mathematics. I am completely new. Kindly elaborate following -

data size of ip datagram = 16bits. So with this $2^{16} -1 = 65536$ 16 bit patterns can be generated. My doubt:

  1. Do we say each 16 bit pattern is 1 IP datagram or all those 65536 patterns as 1 IP Datagram?
  2. If i consider all 65536 patterns as max data size, then max ip datagram size $= 65536$ patterns size$ = 65536*16 $ bits $= 65536*16/8$ bytes $= 65536*2$ bytes
$\endgroup$
3
$\begingroup$

16 bits is not the size of the IP datagram; it is the amount of bits required to encode its length. Hence, you can have datagrams of length up to 65536 octets (i.e., bytes), as described in RFC 760:

Total Length: 16 bits

Total Length is the length of the datagram, measured in octets, including internet header and data. This field allows the length of a datagram to be up to 65,535 octets.

Notice 65536 is not a prescribed length, that is, the length of the datagram is (or can be) variable.


Now, to answer your two questions:

Do we say each 16 bit pattern is 1 IP datagram or all those 65536 patterns as 1 IP Datagram?

Each octet pattern of up to 16-bit length is a datagram. In informal parlance, a datagram is simply a packet which IP adds its header to. You could call the set of all possible patterns a "datagram space", though I doubt that's standard terminology. (You might care to ask that in a separate question.)

If i consider all 65536 patterns as max data size, then max ip datagram size =65536 patterns size=65536∗16 bits =65536∗16/8 bytes =65536∗2 bytes

I'm not sure I see a question here. Though I suppose any one you had is answered by my remark about the datagram length above.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.