[Click] problem with StaticIPLookup

Eddie Kohler kohler at cs.ucla.edu
Sat Mar 6 20:16:44 EST 2010


Victor,

I don't think you have really asked a question here.

StaticIPLookup takes arguments that define the routing table.  An argument 
like "192.168.1.0/255.255.255.0 1", says "packets that match 192.168.1.x 
should be sent to output 1".  And output 1 of the StaticIPLookup is sent 
eventually to eth0.

If you want those packets to be sent to eth1 instead, then just change either 
the routing table entry (specify output 2), or the config (route rt[1] to 
eth1, and rt[2] to eth0).

E


Victor wrote:
> I am really confused with how "StaticIPLookup" is used for packet forwarding
> in basic-router
> 
>  In my basic-router I (see below )  I have configuration for the forwarding
> between 192.168.1.x and 192.168.10.x where (as far as  can see )
> StaticIPLookup output 1 of 192.168.1.x is sent back to eth0, StaticIPLookup
> output2 of 192.168.10.x is sent back to eth1, and both are sent to the local
> stack (ToHost).
> 
> Can someone be so kind to explain the forwarding logic? I would expect to
> see something like:
> 
> "take output of 192.168.1.x, if destination address belongs to 192.168.10.x
> - send it to eth1".  
> 
> Or, is my basic-router.click not created correctly?
> 
> Thanks
> 
> Student of click
> 
>  
> 
> Basic-router.click
> 
>  
> 
> // eth0 192.168.1.176 00:00:C0:3B:71:EF
> 
> // eth1 192.168.10.1 00:00:C0:CA:68:EF
> 
> // Shared IP input path and routing table ip :: Strip(14)
> 
>     -> CheckIPHeader(INTERFACES 192.168.1.176/255.255.255.0
> 
> 192.168.10.1/255.255.255.0)
> 
>     -> rt :: StaticIPLookup(
> 
>       192.168.1.176/32 0,
> 
>       192.168.1.255/32 0,
> 
>       192.168.1.0/32 0,
> 
>       192.168.10.1/32 0,
> 
>       192.168.10.255/32 0,
> 
>       192.168.10.0/32 0,
> 
>       192.168.1.0/255.255.255.0 1,
> 
>       192.168.10.0/255.255.255.0 2,
> 
>       255.255.255.255/32 0.0.0.0 0,
> 
>       0.0.0.0/32 0,
> 
>       0.0.0.0/0.0.0.0 18.26.4.1 1);
> 
> // Input and output paths for eth0
> 
> c0 :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
> 
> PollDevice(eth0) -> c0;
> 
> out0 :: Queue(200) -> todevice0 :: ToDevice(eth0);
> 
> c0[0] -> ar0 :: ARPResponder(192.168.1.176 00:00:C0:3B:71:EF) -> out0;
> 
> arpq0 :: ARPQuerier(192.168.1.176, 00:00:C0:3B:71:EF) -> out0;
> 
> c0[1] -> arpt;
> 
> arpt[0] -> [1]arpq0;
> 
> c0[2] -> Paint(1) -> ip;
> 
> c0[3] -> Print("eth0 non-IP") -> Discard;
> 
>  
> 
> // Input and output paths for eth1
> 
> c1 :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
> 
> PollDevice(eth1) -> c1;
> 
> out1 :: Queue(200) -> todevice1 :: ToDevice(eth1);
> 
> c1[0] -> ar1 :: ARPResponder(192.168.10.1 00:00:C0:CA:68:EF) -> out1;
> 
> arpq1 :: ARPQuerier(192.168.10.1, 00:00:C0:CA:68:EF) -> out1;
> 
> c1[1] -> arpt;
> 
> arpt[1] -> [1]arpq1;
> 
> c1[2] -> Paint(2) -> ip;
> 
> c1[3] -> Print("eth1 non-IP") -> Discard;
> 
>  
> 
> // Local delivery
> 
> toh :: ToHost;
> 
> arpt[2] -> toh;
> 
> rt[0] -> EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> toh;
> 
>  
> 
> // Forwarding path for eth0
> 
> rt[1] -> DropBroadcasts
> 
>     -> cp0 :: PaintTee(1)
> 
>     -> gio0 :: IPGWOptions(192.168.1.176)
> 
>     -> FixIPSrc(192.168.1.176)
> 
>     -> dt0 :: DecIPTTL
> 
>     -> fr0 :: IPFragmenter(1500)
> 
>     -> [0]arpq0;
> 
> dt0[1] -> ICMPError(192.168.1.176, timeexceeded) -> rt;
> 
> fr0[1] -> ICMPError(192.168.1.176, unreachable, needfrag) -> rt;
> 
> gio0[1] -> ICMPError(192.168.1.176, parameterproblem) -> rt;
> 
> cp0[1] -> ICMPError(192.168.1.176, redirect, host) -> rt;
> 
>  
> 
> // Forwarding path for eth1
> 
> rt[2] -> DropBroadcasts
> 
>     -> cp1 :: PaintTee(2)
> 
>     -> gio1 :: IPGWOptions(192.168.10.1)
> 
>     -> FixIPSrc(192.168.10.1)
> 
>     -> dt1 :: DecIPTTL
> 
>     -> fr1 :: IPFragmenter(1500)
> 
>     -> [0]arpq1;
> 
> dt1[1] -> ICMPError(192.168.10.1, timeexceeded) -> rt;
> 
> fr1[1] -> ICMPError(192.168.10.1, unreachable, needfrag) -> rt;
> 
> gio1[1] -> ICMPError(192.168.10.1, parameterproblem) -> rt;
> 
> cp1[1] -> ICMPError(192.168.10.1, redirect, host) -> rt;
> 
>  
> 
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click


More information about the click mailing list