All Classes Namespaces Files Functions Pages
Tutorial: 3. Create our src-port and dst-port

Previous: Tutorial: 2. Connect to ByteBlower Servers

Now that we have a server, we will create a source port and a destination port. Step by step we will show the basic steps for initializing the source port. For the destination port we will use the same methods.

First we create our port on the server. The physical location of this port is the first port on our first trunk switch. So the name for this port is trunk-1-1 ( trunk-1, port 1 ).

1 set srcPort [ $bbServer Port.Create "trunk-1-1" ]

Our port is created and stored in variable $srcPort. Let's move on to Layer2

1 set srcL2 [ $srcPort Layer2.EthII.Set ]
2 $srcL2 Mac.Set "00ff1c000001"

Now that we have configured our Layer2 on our ByteBlowerPort we can create a Layer3. There are 2 types of Layer3 supported by ByteBlower: IPv4 and IPv6. In this example we use IPv4 But you could easly use IPv6 as well. We start by creating the Layer3 Object and then configure it with the apropriate values. 

1 set srcL3 [ $srcPort Layer3.IPv4.Set ]
2 $srcL3 Ip.Set "192.168.1.2"
3 $srcL3 Netmask.Set "255.255.255.0"
4 $srcL3 Gateway.Set "192.168.1.1"

Now, let's do the same for our destination port. The physical location of this port is the second port on our first trunk switch. So the name for this port is trunk-1-2 ( trunk-1, port 2 ).

1 set dstPort [ $bbServer Port.Create "trunk-1-2" ]
2 
3 set dstL2 [ $dstPort Layer2.EthII.Set ]
4 $dstL2 Mac.Set "00ff1c000002"
5 
6 set dstL3 [ $dstPort Layer3.IPv4.Set ]
7 $dstL3 Ip.Set "192.168.1.3"
8 $dstL3 Netmask.Set "255.255.255.0"
9 $dstL3 Gateway.Set "192.168.1.1"

So this is done. Now we have an active source port and an active destination port.

We can now continue to create a Frame we want to send and put it on a Stream.

Further reading: Tutorial: 4. Create a Frame