Hi,

Continue with Create Router part in tutorial, I have questions about
parsing a packet.

Logically, when a packet comes into the controller,
first, the ethernet header needs to be parsed,
if it can’t be deliverd in L2, then parse the IP header, and then,
TCP/UDP/ICMP header.

In packet_in_callback function,

0. from nox.lib.packet.ethernet import ethernet
    from nox.lib.packet.ipv4 import ipv4
    from nox.lib.packet.icmp import icmp

1. if packet.parsed == True
    learn_and_forward_l2_packet (if failed, move to step 2)

2. if packet.type == ethernet.IP_TYPE
    parse the IP header (How to call the “parse” method in ipv4 class?)
    learn_and_forward_l3_packet

Questions:
1. When a packet coming into the controller, by default, it would be
parsed by ethernet first?
2. Could you give an example how to continually parse it by ipv4?

Correct me if anything wrong in the above.

Thank you very much.

Weiyun


> On Jul 3, 2012, at 10:52 AM, we...@pitt.edu wrote:
>
>> Hi,
>>
>> I'm doing the Create Router part in the tutorial. Here are some
>> questions
>> I'm confused about.
>>
>> The topology is like that:
>> h3-eth0 ----- eth1-s1-eth3 ----- eth1-s2-eth2 ----- eth0-h5
>> h4-eth0 ----- eth2-s1
>>
>> h3 and h4 both gateway is s1, but s1 has two interfaces with different
>> MAC. How to add static ARP entry to the host about the s1? Like the
>> following?
>> h3  arp  -s  10.0.1.1  fa:70:27:95:fd:49
>> h4  arp  -s  10.0.1.1  0a:94:cd:59:5a:69
>>
>> If so, the mac addr of each interface on the switch changes everytime I
>> restart the topology. Is there a way to use fixed mac for switch
>> interfaces in the topology script?
>
> MAC addresses reported by Linux for the switch data ports are not
> particularly relevant, since the switch is controlled by OpenFlow and all
> packets coming in (regardless of destination MAC) will be processed under
> OpenFlow's control.
>
> Even more importantly, you should not try to use the Linux IP stack to
> "assign" an IP address to a switch data port.
>
> You can "assign" any MAC you like to the router by simply picking any MAC
> you like and either installing a static ARP entry or generate ARP replies
> with that MAC.
>
> For the tutorial, I recommend installing a static ARP entry in the hosts
> for the gateway IP address (with any MAC you like) and simply doing
> routing based on destination IP address.
>
>>
>> If not, how to?
>>
>> How to use openflow to assign ip to the switch/interface?
>>
>> The way to construct an ARP packet is like this?
>> arp_reply = arp()
>> and then assign values to its attibutes?
>>
>> I know the answers to these questions maybe obvious for you, please help
>> me.
>>
>> Thank you very much.
>>
>> Weiyun
>>
>>
>>
>>
>>
>>
>
>

_______________________________________________
openflow-discuss mailing list
openflow-discuss@lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to