Hi, all:

I want to manage VLAN between two NetFPGA (or more after I solve
problems) by NOX Controller. I grep the keywords "VLAN" and "vlan"
recursively in "src/" directory and found that there are no example
which handling VLAN. And I lose any information?

So I try to write a simple VLAN handling script.

My testing topology is simple:

PC 1: MAC Addr: 00:16:d3:c8:4f:d4 , IP Addr: 192.168.1.1
PC 2: MAC Addr: 00:0f:b0:df:38:18 , IP Addr: 192.168.1.2

OF Switch 1: DP: 336185131409 (00:4e:46:32:01:91)
OF Switch 2: DP: 336185131393 (00:4e:46:32:01:81)

Link topology:

| PC1 | -------- | Port 1 | OF 1 | Port 0 | --------[VLAN ID =
2]-------- | Port 2 | OF 2 | Port 3 |-------- | PC 2 |

I want to add VLAN between OF 1 and OF 2.
My idea is:
1. Add VLAN Header when packet arrive OF 1 and its source MAC is PC 1.
2. Strip VLAN Header when packet arrive OF 2 and its destination MAC is
PC 2.

Then I modified pyswitch.py in "src/nox/coreapps/examples/" and add some
codes in forward_l2_packet function:

http://pastebin.com/GrfNyFLN


It works but in a strange way. PC 1 could send ICMP Request to PC 2 and
receive ICMP Reply from PC2, and vice versa.

I check the flow tables in OF 1 and OF 2, there is a flow entry with
"actions=mod_vlan_vid:2,mod_vlan_pcp:1,output:0" and "dl_vlan=0xffff" in
OF 1, but there are no related flow entries in OF 2. Is there any
mistake because of my misunderstanding?

Because there is no flow entries in OF 2, OF 2 will send every packet to
NOX. And NOX will send "strip VLAN header" command to OF 2 every time.

Another problem is that 10 seconds after PC 1 send ARP Request/Reply to
PC 2, learning switch will forget the normal flow. Then NOX will flood
packets in OF 2 until receive next ARP Request/Reply. It seems that if
packets with VLAN header, it cannot learned by do_l2_learning function?

One of packets:
[00:16:d3:c8:4f:d4->00:0f:b0:df:38:18=VLAN](vlanid=2)[IP]([v:4 hl:5 l:60
t:128] ICMP cs:88f9[192.168.1.1>192.168.1.2]){t:8 c:0 csum: 0xc469}{icmp
id:2 seq:35056}


I tried to explain my problem clearly. Thanks for reading and replying
in advance!

Wen-Pei
_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to