weird ip sequence number

weird ip sequence number

Post by Xinwen - F » Wed, 20 Feb 2002 03:10:23



Hi,
        Really weird!

        I have two linux machines with kernel 2.4.17. When I ping one
machine from the other machine, all the ping request ip packets have the
same sequnce number 0. The ping reply packets have different ip
sequence numbers. Moreover, when I send udp packets using general
socket programming, all the udp packets have the same sequence number 0.

        I use ethereal to check the packets.

        What's the problem?

        Thanks!

Xinwen Fu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

weird ip sequence number

Post by Xinwen - F » Wed, 20 Feb 2002 04:50:13


Hi,
        Now I get that on some OS, for UDP and ICMP packets, the ip
identification fields are not set.

        But I want that every packet has an id. Is there any emthod to get
the current system glocal variable "ip_id" and change it or
enable UDP and ICMP ip identification number somewhere?

        Thanks!

Xinwen Fu


> Hi,
>    Really weird!

>    I have two linux machines with kernel 2.4.17. When I ping one
> machine from the other machine, all the ping request ip packets have the
> same sequnce number 0. The ping reply packets have different ip
> sequence numbers. Moreover, when I send udp packets using general
> socket programming, all the udp packets have the same sequence number 0.

>    I use ethereal to check the packets.

>    What's the problem?

>    Thanks!

> Xinwen Fu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

weird ip sequence number

Post by Alan Co » Wed, 20 Feb 2002 04:50:15


Quote:>    Now I get that on some OS, for UDP and ICMP packets, the ip
> identification fields are not set.

>    But I want that every packet has an id. Is there any emthod to get
> the current system glocal variable "ip_id" and change it or
> enable UDP and ICMP ip identification number somewhere?

IP id is only required on packets that do not have the dont fragment flag
set. Don't rely on it for anything else.

Alan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

weird ip sequence number

Post by Richard B. Johnso » Wed, 20 Feb 2002 05:10:12



> Hi,
>    Really weird!

>    I have two linux machines with kernel 2.4.17. When I ping one
> machine from the other machine, all the ping request ip packets have the
> same sequnce number 0. The ping reply packets have different ip
> sequence numbers. Moreover, when I send udp packets using general
> socket programming, all the udp packets have the same sequence number 0.

>    I use ethereal to check the packets.

>    What's the problem?

>    Thanks!

The sequence numbers for 'ping' come from ping. They are not generated
by the kernel.

`strace` [snipped]

                              |________ sequence NR

sendto(3, "\10\0\237\v\360T\1\0A^q<\277\1\v\0\10\t\n\v\f\r\16\17\20"...,
                            |___________ sequence NR

Cheers,
* Johnson

Penguin : Linux version 2.4.1 on an i686 machine (797.90 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://www.veryComputer.com/
Please read the FAQ at  http://www.veryComputer.com/

 
 
 

weird ip sequence number

Post by Xinwen - F » Wed, 20 Feb 2002 05:30:14


Richard,

> The sequence numbers for 'ping' come from ping. They are not generated
> by the kernel.

> `strace` [snipped]

>                               |________ sequence NR

> sendto(3, "\10\0\237\v\360T\1\0A^q<\277\1\v\0\10\t\n\v\f\r\16\17\20"...,
>                             |___________ sequence NR

I want a true ip_id from the kernel and this id will not be used by
any other packet.

Although there are few chances that our randomly chosen ip_id collides
with the other packet's ip_id generated by kernel, I don't want this
possibility to happen.

So is there any method to get a true ip_id from the kernel?

I want this ip_id to do my own fragmentation on a packet.

Thanks!

Xinwen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

weird ip sequence number

Post by Alan Co » Wed, 20 Feb 2002 05:40:07


Quote:> Although there are few chances that our randomly chosen ip_id collides
> with the other packet's ip_id generated by kernel, I don't want this
> possibility to happen.

So pick one at random. However its a pretty strange way to abuse IP.

Quote:> So is there any method to get a true ip_id from the kernel?
> I want this ip_id to do my own fragmentation on a packet.

Linux does not generate ip idents on DF frames. You can't fragment a DF
frame anyway so the problem does not arrive. Frames without DF get assigned
ip ids
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

weird ip sequence number

Post by Markus Schabe » Wed, 20 Feb 2002 07:50:11


Hi,


> > Although there are few chances that our randomly chosen ip_id
> > collides with the other packet's ip_id generated by kernel, I don't
> > want this possibility to happen.

> So pick one at random. However its a pretty strange way to abuse IP.

And be shure that - according to the standards - the ID/protocol pair should be unique, that means every IP protocol (udp/tcp/icmp/etc...) can have his own, independent ID generation.

Quote:> > So is there any method to get a true ip_id from the kernel?
> > I want this ip_id to do my own fragmentation on a packet.
> Linux does not generate ip idents on DF frames. You can't fragment a
> DF frame anyway so the problem does not arrive. Frames without DF get
> assigned ip ids

I think the OP has some conceptual misunderstanding here. The IP IDs are considered "internal", this means not visible to upper layer protocols.

As soon as an user of IP wants to do his own fragmentation for user data, he/she/it should use his own packet or data ID numbers (as e. G. TCP does with the sequence number, or the ping with the included sequence number).

Markus

--
"GPL software is not free - the cost is cooperation"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/