[Click] Help, Fromhost
wp3891
wp3891 at seu.edu.cn
Tue Dec 1 21:05:22 EST 2009
Dear all,
I have a problem about fromhost when I use Click in USERLEVEL. I want to use Click's StaticLookup to realize a router, but it works just well when the rouer just work as a 'bridge' , for example, two hosts connecting to the router will ping each other well, but when the two hosts connecting each other with two Click Statictable routers , the host will not ping the farther router. I found it is the problem of FromHost. The element of FromHost.u for userlevel is the same with that for kernel level. How could I use FromHost.u for userlevel ?
The topology of my experiment is as follow:
E(IP:10.0.5.3)---------(IP:10.0.5.2)C(IP:10.0.4.2)---------(IP:10.0.4.3)B(IP:10.0.6.2)----------(IP:10.0.6.3)F
When F(10.0.6.3) ping E(10.0.5.3), F will get reply, when F ping C (10.0.4.2), F will get nothing.
The script of C is as follow:
//eth0 10.0.3.3 00:27:19:91:28:22
//eth1 10.0.4.2 00:27:19:90:E6:1B
//eth2 10.0.5.2 00:12:3F:C4:7B:18
ip :: Strip(14)
-> CheckIPHeader(INTERFACES 10.0.6.2/255.255.255.0 10.0.2.3/255.255.255.0 10.0.4.3/255.255.255.0) // here needs reconfigured, all ip/netmask of the three devices
-> Print("before1 rt")
-> IPPrint
-> Print("before2 ")
-> rt :: StaticIPLookup(
10.0.3.3/32 0,
10.0.4.2/32 0,
10.0.5.2/32 0,
// to networks
10.0.1.0/24 10.0.3.2 1,
10.0.2.0/24 10.0.3.2 1,
10.0.3.0/24 10.0.3.2 1,
10.0.4.0/24 10.0.4.3 2,
10.0.5.0/24 3,
10.0.6.0/24 10.0.4.3 2,
0.0.0.0/0.0.0.0 2
////////////////////////////////////////////////////////////////////
);
// ARP responses are copied to each ARPQuerier and the host.
arpt :: Tee(3);
// Input and output paths for eth0
// eth0 10.0.6.2/255.255.255.0 00:12:3f:c1:ce:50 rt[1] 1
c0 :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
FromDevice(eth0) -> c0;
out0 :: Queue(200) -> todevice0 :: ToDevice(eth0);
c0[0] -> ar0 :: ARPResponder(10.0.3.3 00:27:19:91:28:22) -> out0; // here needs reconfigured : ip and mac address of this device
arpq0 :: ARPQuerier(10.0.3.3, 00:27:19:91:28:22) -> out0; // here needs reconfigured : ip and mac address of this device
c0[1] -> arpt; arpt[0] -> [1]arpq0;
c0[2] -> Paint(1)-> ip;
c0[3] -> Discard;
// Input and output paths for eth1
// eth1 10.0.4.3/255.255.255.0 00:0a:eb:1a:61:60 rt[2] 2 10.0.4.3 00:0a:eb:1a:61:60
c1 :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
FromDevice(eth1) -> Print("before c1") -> c1;
out1 :: Queue(200) -> todevice1 :: ToDevice(eth1);
c1[0] -> ar1 :: ARPResponder(10.0.4.2 00:27:19:90:E6:1B)-> out1 // here needs reconfigured : ip and mac address of this device
arpq1 :: ARPQuerier(10.0.4.2, 00:27:19:90:E6:1B) -> out1; // here needs reconfigured : ip and mac address of this device
c1[1] -> arpt; arpt[1] -> [1]arpq1;
c1[2] -> Paint(2) -> ip;
c1[3] -> Discard;
// Input and output paths for eth2
// eth2 10.0.2.3/255.255.255.0 00:14:78:40:40:c4 rt[3] 3 10.0.2.3 00:14:78:40:40:c4
c2 :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -);
FromDevice(eth2) -> c2;
out2 :: Queue(200) -> todevice2 :: ToDevice(eth2);
c2[0] -> ar2 :: ARPResponder(10.0.5.2 00:12:3F:C4:7B:18) -> out2; // here needs reconfigured : ip and mac address of this device
arpq2 :: ARPQuerier(10.0.5.2, 00:12:3F:C4:7B:18) -> out2; // here needs reconfigured : ip and mac address of this device
c2[1] -> arpt; arpt[2] -> [1]arpq2;
c2[2] -> Paint(3) -> ip;
c2[3] -> Discard;
// Local delivery
FromHost(fake0, 10.0.6.1/8)->Print("fuck!1! Fromhost")-> ARPPrint->Print("fuck!2! Fromhost")-> c1;
toh :: ToHost(fake0);
rt[0] ->Print("1-----------------------------")-> IPPrint->Print("-2----------------------------")->EtherEncap(0x0800,1:1:1:1:1:1,2:2:2:2:2:2)->toh;
//arpt[2] -> Discard;
//rt[0] -> Discard;
// Forwarding path for eth0
// eth0 10.0.6.2/255.255.255.0 00:12:3f:c1:ce:50 rt[1] 1
rt[1] -> DropBroadcasts
-> cp0 :: PaintTee(1)
-> gio0 :: IPGWOptions( 10.0.3.3) // here needs reconfigured : ip address of this device
-> FixIPSrc( 10.0.3.3) // here needs reconfigured : ip address of this device
-> dt0 :: DecIPTTL
-> IPPrint /////////////////////////////
-> Print("eth0")
-> fr0 :: IPFragmenter(1500)
-> [0]arpq0;
arpq0[1] -> out0;
dt0[1] -> ICMPError(10.0.3.3, timeexceeded) -> rt; // here needs reconfigured : ip address of this device
fr0[1] -> ICMPError(10.0.3.3, unreachable, needfrag) -> rt; // here needs reconfigured : ip address of this device
gio0[1] -> ICMPError( 10.0.3.3, parameterproblem) -> rt; // here needs reconfigured : ip address of this device
cp0[1] -> ICMPError( 10.0.3.3, redirect, host) -> rt; // here needs reconfigured : ip address of this device
// Forwarding path for eth1
// eth1 10.0.4.3/255.255.255.0 00:0a:eb:1a:61:60 rt[2] 2 10.0.4.3 00:0a:eb:1a:61:60
rt[2] -> DropBroadcasts
-> cp1 :: PaintTee(2)
-> gio1 :: IPGWOptions( 10.0.4.2) // here needs reconfigured : ip address of this device
-> FixIPSrc( 10.0.4.2 ) // here needs reconfigured : ip address of this device
-> dt1 :: DecIPTTL
-> IPPrint /////////////////////////////
-> Print("eth1")
-> fr1 :: IPFragmenter(1500)
-> [0]arpq1;
arpq1[1] -> out1;
dt1[1] -> ICMPError( 10.0.4.2, timeexceeded) -> rt; // here needs reconfigured : ip address of this device
fr1[1] -> ICMPError( 10.0.4.2, unreachable, needfrag) -> rt; // here needs reconfigured : ip address of this device
gio1[1] -> ICMPError( 10.0.4.2, parameterproblem) -> rt; // here needs reconfigured : ip address of this device
cp1[1] -> ICMPError( 10.0.4.2, redirect, host) -> rt; // here needs reconfigured : ip address of this device
// Forwarding path for eth2
// eth2 10.0.2.3/255.255.255.0 00:14:78:40:40:c4 rt[3] 3 10.0.2.3 00:14:78:40:40:c4
rt[3] -> DropBroadcasts
-> cp2 :: PaintTee(3)/////////////////////////////////=========================================3
-> gio2 :: IPGWOptions( 10.0.5.2 ) // here needs reconfigured : ip address of this device
-> FixIPSrc( 10.0.5.2 ) // here needs reconfigured : ip address of this device
-> dt2 :: DecIPTTL
-> IPPrint /////////////////////////////
-> Print("eth2")
-> fr2 :: IPFragmenter(1500)
-> [0]arpq2;
arpq2[1]-> out2;
dt2[1] -> ICMPError( 10.0.5.2, timeexceeded) -> rt; // here needs reconfigured : ip address of this device
fr2[1] -> ICMPError( 10.0.5.2, unreachable, needfrag) -> rt; // here needs reconfigured : ip address of this device
gio2[1] -> ICMPError( 10.0.5.2, parameterproblem) -> rt; // here needs reconfigured : ip address of this device
cp2[1] -> ICMPError( 10.0.5.2, redirect, host) -> rt; // here needs reconfigured : ip address of this device
wp3891
2009-12-02
More information about the click
mailing list