Networking Forums

Networking Forums > Computer Networking > Linux Networking > ip aliases with 2.4 kernel

Reply
Thread Tools Display Modes

ip aliases with 2.4 kernel

 
 
Wolter Kamphuis
Guest
Posts: n/a

 
      01-05-2004, 02:54 PM
Hi all,

I'm busy developing a client/server system which uses broadcast to
communicate. I would like to use ip aliases to simulate a single network
with many clients and one server. The clients would be listening to lo:*
(127.0.0.*) and the server would be broadcasting to the lo network
(127.0.0.255). However ip aliasing seems to be removed from the 2.4 kernels.

Does anyone know a way to have ip aliasing back in the 2.4 kernel or an
other way to do the above simulation? Only one client at a time can bind
to a interface so I basically need a few extra lo interfaces.

thanks in advance,
Wolter Kamphuis

 
Reply With Quote
 
 
 
 
Juha Laiho
Guest
Posts: n/a

 
      01-05-2004, 06:37 PM
Wolter Kamphuis <(E-Mail Removed)> said:
>I'm busy developing a client/server system which uses broadcast to
>communicate. I would like to use ip aliases to simulate a single network
>with many clients and one server. The clients would be listening to lo:*
>(127.0.0.*) and the server would be broadcasting to the lo network
>(127.0.0.255). However ip aliasing seems to be removed from the 2.4 kernels.


[root@ichaos linux]# ifconfig lo:0 127.0.0.2 up
[root@ichaos linux]# ifconfig -a
....
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:3708335 errors:0 dropped:0 overruns:0 frame:0
TX packets:3708335 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

lo:0 Link encap:Local Loopback
inet addr:127.0.0.2 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1

[root@ichaos linux]# uname -r
2.4.23-pre5

>Does anyone know a way to have ip aliasing back in the 2.4 kernel or an
>other way to do the above simulation?


I tried to look at my kernel configuration, but couldn't find a way to
_disable_ the aliasing. So, could you tell in what way is your aliasing
not working?
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 
Reply With Quote
 
Wolter Kamphuis
Guest
Posts: n/a

 
      01-06-2004, 08:04 AM


Juha Laiho wrote:
> Wolter Kamphuis <(E-Mail Removed)> said:
>
>>I'm busy developing a client/server system which uses broadcast to
>>communicate. I would like to use ip aliases to simulate a single network
>>with many clients and one server. The clients would be listening to lo:*
>>(127.0.0.*) and the server would be broadcasting to the lo network
>>(127.0.0.255). However ip aliasing seems to be removed from the 2.4 kernels.

>
>
> [root@ichaos linux]# ifconfig lo:0 127.0.0.2 up
> [root@ichaos linux]# ifconfig -a
> ...
> lo Link encap:Local Loopback
> inet addr:127.0.0.1 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:16436 Metric:1
> RX packets:3708335 errors:0 dropped:0 overruns:0 frame:0
> TX packets:3708335 errors:0 dropped:0 overruns:0 carrier:0
> collisions:0 txqueuelen:0
>
> lo:0 Link encap:Local Loopback
> inet addr:127.0.0.2 Mask:255.0.0.0
> UP LOOPBACK RUNNING MTU:16436 Metric:1
>
> [root@ichaos linux]# uname -r
> 2.4.23-pre5
>
>
>>Does anyone know a way to have ip aliasing back in the 2.4 kernel or an
>>other way to do the above simulation?

>
>
> I tried to look at my kernel configuration, but couldn't find a way to
> _disable_ the aliasing. So, could you tell in what way is your aliasing
> not working?


Oops... made a mistake. I tried a few commands I remembered by heart.
Those commands failed so I searched the Internet and found
http://www.faqs.org/docs/Linux-mini/IP-Alias.html. It states "IP Alias
is standard in kernels 2.0.x and 2.2.x, and available as a compile-time
option in 2.4.x (IP Alias has been deprecated in 2.4.x and replaced by a
more powerful firewalling mechanism.)". I assumed they had removed ip
aliasing completely since I too couldn't find any references to ip
aliasing. The "ifconfig lo:0 127.0.0.2 up" command works here too so
it's still there, but a bit hidden.

thanks,
Wolter Kamphuis

 
Reply With Quote
 
Cedric Blancher
Guest
Posts: n/a

 
      01-06-2004, 08:47 AM
Dans sa prose, Wolter Kamphuis nous ecrivait :
> (IP Alias has been deprecated in 2.4.x and replaced by a
> more powerful firewalling mechanism.)


IP aliasing using ifconfig is deprecated because people oftem get mistaken
about what an alias is, as it creates confusion between interfaces and
aliases.

To affect aliases, it is recommanded to use :

ip address add $IP dev $iface

Problem is you don't see such addresses through ifconfig, you have to list
them using :

ip address list

--
BOFH excuse #204:

Just pick up the phone and give modem connect sounds. "Well you said we
should get more lines so we don't have voice lines."

 
Reply With Quote
 
Floyd Davidson
Guest
Posts: n/a

 
      01-06-2004, 09:22 AM
Wolter Kamphuis <(E-Mail Removed)> wrote:
>Juha Laiho wrote:
>> Wolter Kamphuis <(E-Mail Removed)> said:
>>
>>> I'm busy developing a client/server system which uses
>>> broadcast to communicate. I would like to use ip aliases to
>>> simulate a single network with many clients and one
>>> server.


That is *not* a good idea! What happens is that, despite your
best efforts to avoid it, your code will end up depending on the
synchronous nature of executing the client and the server on a
single system. When you move it to a real network the client
and server will by asynchronous, and timing problems that would
have been easy to spot in the early stages of development will
be much more difficult to track down.

>>> The clients would be listening to lo:* (127.0.0.*)
>>> and the server would be broadcasting to the lo network
>>> (127.0.0.255). However ip aliasing seems to be removed from
>>> the 2.4 kernels.

>> [root@ichaos linux]# ifconfig lo:0 127.0.0.2 up
>> [root@ichaos linux]# ifconfig -a
>> ...
>> lo Link encap:Local Loopback
>> inet addr:127.0.0.1 Mask:255.0.0.0


You've missed the significance of the Mask value. Any address
from 127.x.x.x will be sent to the lo device!

>> UP LOOPBACK RUNNING MTU:16436 Metric:1
>> RX packets:3708335 errors:0 dropped:0 overruns:0 frame:0
>> TX packets:3708335 errors:0 dropped:0 overruns:0 carrier:0
>> collisions:0 txqueuelen:0


What the above means, is that the below isn't needed. It's already
done!

>> lo:0 Link encap:Local Loopback
>> inet addr:127.0.0.2 Mask:255.0.0.0
>> UP LOOPBACK RUNNING MTU:16436 Metric:1


Instead of doing that, just try to ping 127.0.0.2, or *any* valid
127.x.x.x address. Which also means you can put a name in your
/etc/hosts file associating the name to that IP address, as well
as others if you need them:

127.0.0.1 localhost
127.0.0.2 localhost.localdomain
127.5.0.1 test1 test1.localdomain
127.5.0.2 test2 test2.localdomain
127.5.0.3 test3 test3.localdomain

And that will make *all* of those names accessable as a loopback.

....
>mechanism.)". I assumed they had removed ip aliasing completely
>since I too couldn't find any references to ip aliasing. The
>"ifconfig lo:0 127.0.0.2 up" command works here too so it's
>still there, but a bit hidden.


But, totally unnecessary for what you are doing with it.

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
Wolter Kamphuis
Guest
Posts: n/a

 
      01-06-2004, 11:18 AM
hi,

Floyd Davidson wrote:
> That is *not* a good idea! What happens is that, despite your
> best efforts to avoid it, your code will end up depending on the
> synchronous nature of executing the client and the server on a
> single system. When you move it to a real network the client
> and server will by asynchronous, and timing problems that would
> have been easy to spot in the early stages of development will
> be much more difficult to track down.
>

It's a very simple c/s system I'm building, timing won't be much of a
issue. I would like to test the robustness of the protocol/state machine
when for example one of the clients dies during a session. Weird timing
issues will even help make the protocol more stable since the protocol
has to cope with (very) bad lines and missing packets. These tests are
just to demonstrate the protocol, real world tests will be done too.


>>>>The clients would be listening to lo:* (127.0.0.*)
>>>>and the server would be broadcasting to the lo network
>>>>(127.0.0.255). However ip aliasing seems to be removed from
>>>>the 2.4 kernels.
>>>
>>>[root@ichaos linux]# ifconfig lo:0 127.0.0.2 up
>>>[root@ichaos linux]# ifconfig -a
>>>...
>>>lo Link encap:Local Loopback
>>> inet addr:127.0.0.1 Mask:255.0.0.0

>
>
> You've missed the significance of the Mask value. Any address
> from 127.x.x.x will be sent to the lo device!
>
>
>>> UP LOOPBACK RUNNING MTU:16436 Metric:1
>>> RX packets:3708335 errors:0 dropped:0 overruns:0 frame:0
>>> TX packets:3708335 errors:0 dropped:0 overruns:0 carrier:0
>>> collisions:0 txqueuelen:0

>
>
> What the above means, is that the below isn't needed. It's already
> done!
>
>
>>>lo:0 Link encap:Local Loopback
>>> inet addr:127.0.0.2 Mask:255.0.0.0
>>> UP LOOPBACK RUNNING MTU:16436 Metric:1

>
>

ok

Next problem. The clients are listing to 127.0.0.1, 127.0.0.2,
127.0.0.3.. etc. Packets to 127.0.0.1, 127.0.0.2... are received but
they don't seem to get the broadcasts to 127.255.255.255. Only when the
clients bind to INADDR_ANY they get the broadcasts but only one client
can bind to INADDR_ANY. Setting SO_BROADCAST doesn't make a difference.

Anyone got a solution to have multiple programs receive the same
broadcasts on a single computer?

thanks in advance,
Wolter Kamphuis

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get data in kernel SEND buffer for a TCP socket from a netfilter based kernel module Rohit Linux Networking 0 05-10-2007 11:27 AM
ethernet aliases & kernel? billis Linux Networking 1 02-21-2007 09:58 PM
killing a kernel thread ....... UDP server (kernel module)......... alex Linux Networking 0 09-20-2006 11:26 AM
PCMCIA SMC2835W card not recognized by kernel-2.4.* and kernel-2.6.5 Jorge Ventura Linux Networking 0 05-03-2004 08:08 PM
ip aliases vs subnets on RH9 Les Mikesell Linux Networking 0 12-11-2003 02:15 AM



1 2 3 4 5 6 7 8 9 10 11