Hello,

The reason why dpid isnot static during the switch execution on
openwtr is the following:


./udatapath/datapath.c from [1], which is the openflow implementation
used by openwrt.
--------------------------------
/* Generates and returns a random datapath id. */
static uint64_t
gen_datapath_id(void)
{
    uint8_t ea[ETH_ADDR_LEN];
    eth_addr_random(ea);
....

[1] http://openflowswitch.org/downloads/openflow-1.0.0.tar.gz

On the other hand, the specification of OF 1.0 says (section 5.3.1):

/* Switch features. */
struct ofp_switch_features {
    struct ofp_header header;
    uint64_t datapath_id;   /* Datapath unique ID. The lower 48-bits are for
                               a MAC address, while the upper 16-bits are
                               implementer-defined. */


So, I guess I will have to use the ip address used by the switches to
connect to the controller in order to identify them. :(


On Tue, Jul 24, 2012 at 8:27 PM, Italo Valcy <[email protected]> wrote:
> Hello guys!
>
> I'm starting to learn about openflow and trying to implement the task
> 7 of OpenFlow Tutorial [1]. I'm using two switches (openwrt) and one
> controller (pox). My doubt is: how can I identify each switch? I need
> to identify each switch because they have individual configurations
> (e.g. distinct ip address). I've tried to use datapath-id, but the
> datapath-id change over the time...
>
> What I'd like to do is something like:
>
>       # openwrt1
>       sw = L3_Switch()
>       sw.set_id('SOME-ID1')
>       sw.add_ip('192.168.2.1')
>       sw.add_ip('192.168.3.1')
>       sw.add_route('192.168.4.0/24','192.168.3.2')
>       switches[sw.id] = sw
>
>       # openwrt2
>       sw = L3_Switch()
>       sw.set_id('SOME-ID2')
>       sw.add_ip('192.168.3.2')
>       sw.add_ip('192.168.4.2')
>       sw.add_route('192.168.2.0/255.255.255.0','192.168.3.1')
>       switches[sw.id] = sw
>
> The problem of using datapath-id is that it change a lot... (at least
> in openwrt implentation of openflow 1.0, each restart of the openflow
> daemon results in a different dpid). I throught about to use the ip
> address used by the switch to contact the controller, but I dont know
> if I'm going through the right way.
>
> What do you guys think? Can you help me?
>
> Thanks for any help!
>
>
> [1] http://www.openflow.org/wk/index.php/OpenFlow_Tutorial#Create_Router
>
>
> --
> Saudações,
>
> Italo Valcy :: http://wiki.dcc.ufba.br/Main/ItaloValcy



-- 
Saudações,

Italo Valcy :: http://wiki.dcc.ufba.br/Main/ItaloValcy
_______________________________________________
openflow-discuss mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to