Well the usual way to do what you describe here is to have Open vSwitch encapsulate the packet in a tunneling protocol like GRE or NVGRE or VXLAN or what-have-you.
The edge_switch and edge_pairs POX components in my experimental branch do this sort of thing and have a description of how I set up in Mininet for testing: https://github.com/MurphyMc/pox/blob/experimental/pox/edge/edge_switch.py (I think both of those could probably be somewhat improved now. They were fighting a bug in OVS and the fact that POX didn't have ovsdb support at the time, if I recall correctly.) -- Murphy On Nov 16, 2014, at 3:53 AM, david jhon <djhon9...@gmail.com> wrote: > Hi Murphy, > > Thanks for your reply. > > I am doing this to simulate a multi-tenant data center via mininet where a > single physical host is running multiple guest Virtual machines just as given > in the file attached. Traffic generated by these virtual machines should be > encapsulated in L2/L3 header of physical host as I want to test behavior of > overlay traffic. > > I'll be really grateful for your suggestion/help in this regard. > > Thanks and Regards, > > On Fri, Nov 14, 2014 at 3:52 PM, Murphy McCauley <murphy.mccau...@gmail.com> > wrote: > This doesn't have much to do with Mininet or OpenFlow or POX's usual > use-cases, which all have to do with switches. You're describing atypical > behavior you want a *host* to implement. Off the top of my head, I don't > know a way to get what you want with any normal Linux networking > configuration or even OVS (though if you wanted to use OVS, it's not clear > why you'd have hosts in the middle of the topology anyway). > > A pretty common way to do what you want would be to write a userspace program > which opens AF_PACKET "raw" sockets on the two interfaces and does the > encapsulation. This could also be done with libpcap. Indeed, you could do > it with POX's pxpcap library pretty easily if performance wasn't an issue. > If performance was really an issue, you'd probably use something like Intel's > DPDK. > > As a sidenote, you'll want to watch out for the MTU. > > -- Murphy > > On Nov 13, 2014, at 9:14 PM, david jhon <djhon9...@gmail.com> wrote: > > > Hi everyone, > > > > I have created following topology in mininet: > > > > h1-----s1------h2-------s2------h3-----s3-----h4 > > > > I want to ping h4 from h1 but I want every packet between h1 <---> h4 to > > pass through h2 and h3 such that a packet coming from h1 is encapsulated in > > L2 and L3 packet of h2 and then forward this modified packet to s2, s2 > > should forward the encapsulated packet to h3, h3 should remove l2/l3 > > headers appended by h2 and forward this decapsulated packet to s3 which in > > turn should be forwarded to h4 by s3. > > > > How can I make this thing happen in mininet and pox? > > > > Any suggestion/tip/link or help is welcomed. > > > > Thanks and Regards, > > > > David > > > > > > > <unnamed.jpg>