[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] IPv6 design considerations

From: Simon Goldschmidt
Subject: Re: [lwip-devel] IPv6 design considerations
Date: Tue, 09 Nov 2010 08:04:35 +0100

"Ivan Delamer" <address@hidden> wrote:
> 1) IP_PCB
> I have changed the field:
>     ip_addr_t local_ip;
> to
>     union {
>       ip_addr_t ip4;
>       ip6_addr_t ip6;
>     } local_ip;
> Same for remote_ip. I have also added a u8_t isipv6; field to determine if
> the PCB is for a v4 or v6 connection.

If that's enough that's fine. However, I would have thought we would need a new 
ip_addr_t-like struct that contains both the union and a type information (i.e. 
"isipv6"). For example, after creating a new tcp pcb, it would be nice to just 
pass in the address and connect to whatever the address points to. Otherwise, 
you would need different connect functions for v4 and v6 (as the address then 
has a different type).

The downside is that the size of ipv4 addresses increases (which is quite 
optimal with 4 bytes, currently).

> [..]
> This requires some refactoring, as all code must be changed as follows:
>   pcb->local_ip   to:    pcb->local_ip.ip4

With the above proposal, only the code that specifically knows it works on v4 
addresses has to be changed (i.e. ".ip4" added), which shouldn't include too 
many files.

> 2) tcp_input, udp_input, raw_input, icmp6_input
> [..]

Agreed. The current state is a bit awkward, anyway (it has been like that for 
"historical" reasons: ip_current_header has only been introduced lately).

> 3) netif struct
> I have added an array of ip6_addr_t and some pointers to dhcp6 and autoip6
> structs. This seems pretty straight forward.

Why add an array of ipv6 addresses? I would have thought on link-local address 
and one routable address should be enough for an embedded device?

Did you implement dhcp6 already? I don't think you can just reuse dhcpv4 (which 
should be moved to the ipv4 subdirectory, btw), can you?

Oh, and isn't autoip a v4-only protocol? I thought v6 has link-local addresses 
assigned automatically?

> I also added a new output function "output6" and and input function
> "input6".

Seems like the way to go, yes.

I really appreciate your effort on this! I do hope this can be merged to CVS in 
the near future.

GRATIS! Movie-FLAT mit ├╝ber 300 Videos. 
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome

reply via email to

[Prev in Thread] Current Thread [Next in Thread]