Changes between Version 1 and Version 2 of Tutorials/Layer2Ping/Procedure/Execute

02/09/15 10:20:12 (9 years ago)



  • Tutorials/Layer2Ping/Procedure/Execute

    v1 v2  
    1 = [ Layer2Ping or PingPlus Exercise] =
     1= [ Getting Started With GENI - Part 2 Exercise 2] =
     19== 2. Execute the Experiment ==
     21=== 2.1 Open two terminal windows ===
     22Click on the terminal program icon on the dock to the left of your screen.  This will open up a terminal.  From the "File" menu of the terminal program, select "New Window" to open a second terminal window.
    21 == 1.  Design the Experiment ==
    23 In today's experiment you will use resources from the aggregate listed on your worksheet.
     24=== 2.2 Log into the server node ===
     25From terminal 1, ssh into the server node.
     27'''ExoGENI Rack:'''  {{{ssh -p <server_port_num> -l root <server_ip_addr> }}}
    26 == 1.1  Obtain Resources ==
     29'''InstaGENI Rack:''' {{{ssh -p <server_port_num> <server_name> }}}
    28 You can use the portal, Jacks or Omni to create your slice and allocate resources.  The instructions here assume you are using Jacks.
     31=== 2.3 Log into the client node ===
     32From terminal 2, ssh into the client node.
    30 Click on the project name and find the slice you created earlier in this tutorial.
     34'''ExoGENI Rack:'''  {{{ssh -p <client_port_num> -l root <client_ip_addr> }}}
     36'''InstaGENI Rack:''' {{{ssh -p <client_port_num> <client_name> }}}
    33 === 1.2 Reserve Two Virtual Machines at One Aggregate ===
    34 We will use the same topology used in the previous exercises: Two nodes connected by a link.
     38=== 2.4 Gather information about the network interfaces on the server and client ===
     39Find the name and hardware address (MAC address) of the data network interface on the server and the client.
    36 The RSpec you will need is at
     411. In terminal 1 where you are logged into the server, type {{{ifconfig}}}.  This will list all network interfaces on the server.  Look for the interface with the IP address,  This is the IP address specified in our request RSpec.   On your worksheet record the name and hardware address of this interface.
    38 You can import this RSpec directly via the portal, into Jacks, or use it with Omni.  Please use the same aggregate (rack) you used for your other exercises. 
     432. In terminal 2 where you are logged into the client, type {{{ifconfig}}}.  This will list all network interfaces on the server.  Look for the interface with the IP address,  This is the IP address specified in our request RSpec.   On your worksheet record the name and hardware address of this interface.
    40 Wait until the Jacks canvas turns green.  If you are using Omni, wait until tells you your resources are ready and gives you ssh commands you can use to log into your nodes.  If you are using the portal, wait until the slice page tells you that your resources are ready and you can get your login details via the ''"Details"'' button.
     45=== 2.5 Verify you can connect to the client from the server and vice versa ===
     46We will use ping to do this.
    42 === 1.3 Note the ssh information for the server and client nodes ===
    43 In you worksheet, write down the IP addresses and port numbers used to ssh into the server and client nodes.
     48   1. In terminal 1 (server node), type {{{ping -c 3}}}.
     49   2. In terminal 2 (client node), type {{{ping -c 3}}}.
    45 ----
    46 = [wiki:Tutorials/Layer2Ping/Procedure Introduction] =
    47 = [wiki:Tutorials/Layer2Ping/Procedure/Execute Next:  Execute] =
     51If the pings succeed you know you have IP connectivity between the two nodes.
     53=== 2.6 Download and install !PingPlus on the server and client nodes ===
     54We will download and install a program that does Layer 2 pings on the server and client nodes.  Do this on both nodes:
     55   {{{
     56   wget
     57   tar xvfz pingPlus-0.2.tar.gz
     58   }}}
     59You should see a directory called {{{pingPlus-0.2}}}.  This directory has the source code for {{{pingPlus}}}.
     61=== 2.7 Compile pingPlus ===
     62Do this on both nodes:
     64'''ExoGENI: ''' ExoGENI nodes do not include a compiler.  Download and install the compiler:
     65   {{{
     66   apt-get update
     67   apt-get install build-essential
     68   }}}
     70We are now ready to compile {{{pingPlus}}}:
     71   {{{
     72   cd pingPlus-0.2
     73   make
     74   }}}
     76=== 2.8 Turn off IP on the data interface ===
     77We now turn off IP on the data interface.  ''Be very careful to not turn off IP on any of the other interfaces as this will make your node unreachable.''
     80   {{{
     81   service neuca stop
     82   /sbin/ifconfig <data_interface_name>
     83   }}}
     86   {{{
     87   sudo /sbin/ifconfig <data_interface_name>
     88   }}}
     90=== 2.9 Run {{{pingPlus}}} ===
     91In terminal 1 (server node):
     92   {{{
     93   ./pingPlusListener 10002
     94   }}}
     95The 10002 is the value we'll use for the type field in the header of the Ethernet frames we send and receive.  The above command tells the server to look for Ethernet packets of this type.  (In this exercise you can use almost any value for this type field.)
     97In terminal 2 (client node):
     98   {{{
     99   ./pingPlus <server_data_interface_hardware_addr> <client_data_interface_name> 10002
     100   }}}
     101This tells the client to send an Ethernet frame with destination address set to the server's data interface MAC address and with the type field set to 10002.  This frame will be sent out of the specified interface on the client. 
     103The client prints out the contents of the data field of the frame it sent to the server and the contents of the data field in the frame it got back from the server.
     105In terminal 1 (server node), kill the {{{pingPlusListener}}} by typing {{{control-c}}}.
     107=== 2.10 Examine the {{{pingPlus}}} program ===
     108Open up an editor (vi or emacs) to view {{{pingPlus.c}}}.  All the interesting stuff happens starting line 110 of this file:
     109     - Open a Layer 2 socket (lines 110 - 115)
     110     - Bind the socket to the specified interface (lines 117 - 125)
     111     - In a buffer compose the contents of the data portion of the Ethernet frame to be sent to the server.  In our case the data portion has the format "RQ:<randomNumber>+<randomNumber>"   (line 133)
     112     - Send the packet.  The send is successful if the return from {{{sendPacket}}} matches the number of bytes sent.   The {{{sendPacket}}} function is implemented in the file {{{packetFunctions.c}}} in this directory.  This function sets the appropriate header fields in the ethernet frame before sending it.
     113     - Wait for the server to respond (line 145).  The {{{receivePacket}}} function is implemented in file {{{packetFunctions.c}}}.
     115=== 2.11 Modify {{{pingPlus}}} to measure round-trip delays ===
     116You should by now have a feel for how Layer 2 sockets work.   You can now modify ping2Plus to measure round-trip delays similar to the Layer 3 ping.  You will want to:
     117    - get the current time before you send the packet using
     118    - get the current time when you get a response from the server.
     120=== 2.12 (Optional) Get a solution to the exercise ===
     121To see a solution to this exercise, create a new directory and dowload the solution to that directory:
     122    {{{
     123    cd
     124    wget         tar xvfz pingPlus_v3.tar.gz
     125    cd pingPlus_v3
     126    }}}
     127 The file {{{pingPlus.c}}} in this directory will have the solution.   The statements that do the timing measurement are around lines 151 and 175.
     129= [wiki:GEC17Agenda/GettingStartedWithGENI_II/Exercise2/Procedure/Finish Next: Finish] =