FAQ for IP Lab #1



If you are still in trouble even after going through the FAQs, look at the bulletine board in WebCT.
If there is nothing like your question, post it on the board.


Q. Compiling error: libsim not found.

A. Change the $HOSTTYPE  to RISC6000 then you can find those libs.
Try typing:

setenv HOSTTYPE RISC6000




Q. How do you display back from a remote workstation ?

A. First on the local workstation type:

xhost [ Remote Hostname ]
Then on the remote workstation type:
setenv DISPLAY [ Local Hostname ]:0.0
This will allow you to display the GUI on you local workstation.



Q. For Part 1, frag1.config and frag5.config do not give any output even after increasing the debug level. How do I find the average fragmentation per packet in those cases?

A. frag1 and frag5 packets do not get fragmented!!!!



Q. The demo will output the following:
Time:   37.221 ms. Node net2. Received 329 pkts, 1856 fragments. Max Partially Reass pkts =7
which contains the info needed to do most of the calculations for the deliverables.

This does not show up in my implementation when I increase the debug level.
Is this something that I need to implement aswell?

A. You need to uncomment the debug statements in the code template you have.



Q. In the FragmentPacketAndSendToDLC function, I do not understand what the variable called dataoffset is.  What do you mean by "app packet"?  I guess you mean the original packet that came from the application layer, input_pdu.  But what is the difference between dataoffset and offset_in_datagram?

The code says:

 dataoffset,    /* offset within app packet for next fragment */
 offset_in_datagram; /* fragment offset to be written in new fragment header */
A.
     /* dataoffset: offset within app packet for next fragment. 16 bits */
          dataoffset = 0;
     /* frag offset in datagram: consider old fragment offset too. 16 bits. */
          offset_in_datagram =  (old_fragoff & IP_FRAGOFF) << 3;


To minimize confusion, the above is the correct code for the initialization of these two variables - to help you get started.  Basically dataoffset refers to a running pointer into the datagram or application packet which is being fragmented. You have to increment it by the maximum possible fragment size (calculate this from the MTU size) to get the next chunk of payload to be packaged into the next fragment.

offset_in_datagram should consider old fragment offset too because you can fragment an already fragmented datagram further in the middle of the network. You should not increment it by 1 as you suggest below -- this
variable has the units of "bytes" -- which means that you should increment it by the appropriate number of bytes you have put into each fragment.



Q. My program compiled before, but now, I met problem when I tried to make it, it says:

/tmp/ccl11jMa.s: line 3954: Cannot create network_layer.o
make: The error code from the last command is 1.

A. I got this problem as well. My previous executable ran into an infinite loop and was coredumped. Because this file is large you may overshoot your rcs quota. so try removing core and make again



Q. I run out of disk space whenever my program dumps core!

A. use the command

$ ulimit -c 0
Core file size will be limited to 0 bytes.


Q. The makefile can not locate X11 in cisePort.h ?

A. Are you using an AIX machine? Remember to login only to the known AIX machines in RCS (The command uname will give you what OS you are on).


Q. How do I capture an image ?

A. Use the  xv utility.
When the little fish appear click the right mouse button in the window. Then you will see a button on the bottom named "Grab" click that and follow the directions. After clicking Grap use the middle mouse button to draw a rectangle around the area you want to capture.



Q. Am I calculating maxdlen correctly:    maxdlen = (mtu-20)/8;

A. No. we do not want to divide the data into 1/8th the mtu size.  We just want it to satisfy the constraint that it should be the highest multiple of 8 (its lower 3 bits should be 0) less than mtu. This can be done for eg. by (mtu-IPMHLEN)&~7



Q. The graphics code:  In ipreass, for example, you have some graphics code that you say should not be removed.  Should this code be in the part of the if statement I create for no reassembly needed?  If so, does it matter where?

A. You are right - it should be part of the "no reassebly reqd" part.

In general, keep in mind that we have provided comments almost each and every line of the code at its appropriate position. We basically wrote the code + comments and removed the code ... I would recommend that you do not move the graphics code from its current position and simply "fill in the blanks" for the remaining code.



Q. Do we ever have to call ipftimer?  If so, when?

A. No. It is called by a section of code that is transparent to you.
We provided the description for completeness.



Q. What is bcopy?  I can't find it as a standard C command.  I'm guessing it's something like byte copy.

A. Yes. The order of source/destination in the argument list differs from strcpy(). A man page exists:

Try:

man bcopy


Q. Do all of the given functions get used at one point or another in the code we have to write?

A. Usually - sometimes it might be transparent to you - like ipftimer. I cant recall another case ...



Q. It's been a while since I did any serious C coding, so let me know if this is right:  "->" is used for pointers that point to structures, right?

A. Yes. You might do well to have a C reference book handy.



Q. I am setting up the variables. I set "int src= input_pdu->ip_src". The compiler tells says structure has no member names ip_src, for this line and ones similiar to it. How do I access the value ip_src in the structure?

A. . Try using: input_pdu->u.n_pdu.ip_src



Q. I hear a lot of people are having trouble with the following error in lab1:
Empty n_pdu
IOT/Abort trap (core dumped)


A. These answers were sugested by students!!



Q. I get the same error "Empty n_pdu" for all the cases. This does not happen during any of the subroutines that we are supposed to modify.

A. Maybe you didn't format some parameters correctly before calling some routines.  For example, when formate packet to be handed into application layer, you might   make some careless mistake so that inproper packet is handed in and that will   cause problem later in some routines you didn't write.



Q. What could possibly be causing the error identified by the statement:

   app2: Unknown packet type

A. It might happen when you try assembling incorrect data. Check how you are fragmenting and unfragmenting it.



Q.  My program works perfectly except for one thing: in frag2.conf through frag5.conf, after around 52 packets have been reconstructed, I get a segmentation fault and a core dump every time I run it.  I'm wondering if I'm not releasing some resource that I've overlooked.  In ipfcons, I have at the end:
 
/* Release resources in fragment table: ordered list, state variables */
FreeOrderedList(iq->ipf_q);


A. I forgot state variable:

iq->ipf_state = IPFF_FREE;




Q. How to use ssh ?

A. Type the following without the < >    :
    ssh -l <your-id-on-remotemachine> <remote-machine>
    or ssh <your-id-on-remotemachine>@<remote-machine>

    For example:

    ssh -l testid rcs-ibm2.rpi.edu
         ---
           |--------->  This is an 'L' in small letters, not a '1' .

    or

    ssh testid@rcs-ibm2.rpi.edu



Q. How do I get SSH  ?

A.

General Info:
      http://www.ssh.fi/          (free stuff)
      http://www.datafellows.com/ (non free stuff)

Win:   (ssh1/2)  (Just get the trial version)
      http://www.datafellows.com/download-purchase/
      choose "F-Secure SSH Tunnerl&Terminal for Windows" from the first popup

MacOS: (ssh1/2)  (Just get the trial version)
      http://www.datafellows.com/download-purchase/
      choose "F-Secure SSH Tunnerl&Terminal for Macintosh" from the first popup

the unix ssh client/server also does X11 forwarding (over the active connection) so there is no reason to export a DISPLAY assuming both sides are setup to allow it.



 

RSVP FAQ - Getting it to run remotely ...





Q. Poor image quality of node2 in the Frag_demo program

A. I have solved the poor image quality of node2 in the Frag_demo program.  I tried several things...

I am working from home (with RoadRunner) using both my Linux machine and my Win98 machine.

I telnet to the Linux machine and use ssh to login to an IBM AIX machine at RPI.  Using eXceed (X-Server for windows) I can bring the display to the Win98 machine. Using this method the node2 appears as a red wire mesh of the planet earth. From the console of the Linux machine the planet earth on node2 appears as a nice blue wire mesh. I rebooted Win98 machine to Linux.  Nice blue wire mesh.  I decided to monkey with the color depth.
Initially it was at 32 bpp yielding blue mesh.  Then went down to 8 bpp yielding a perfect planet earth. It turns out that in Win98 I was running at 24 bpp.

If you are going to qualitatively assess the performance for each of the fragX.config make sure that your display is set down to 8 bpp.

For on campus this is probably not an issue as 8 bpp is default on most of the UNIX machines.



Q. I  have problems using ssh version 2

A. Please do not use ssh version 2.
SSH 1.1 should work

Try to see if you can get an older version of F-Secure's SSH, or at least not ssh2.



Q. exporting the DISPLAY does not work. X packets are not allowed to traverse the firewall.

A. I have solved the firewall connectivity problem. At least for myself here at IBM Burlington.  Hopefully this info may help the other sites with firewalls. I was able run Frag_demo with little trouble.

Solution: encapsulate the X packets with ssh which creates a virtual tunnel for packets between the client and server.  It does this by encryping the X packets and returning them allong the same port as the ssh session. it sets DISPLAY=cortez.sss.rpi:3.0 for example. ("proxy Xserver")

1. install ssh client on an internal machine. (as root)
2. use ssh-keygen to create private/public key pair. (as user)
3. copy the contents of $HOME/.ssh/identity.pub (on local acct) to
$HOME/.ssh/authorized_keys in RCS acct (via rftp)
4. ssh -l <RCSuserName> cortez.sss.rpi.edu   (add -v to debug)



Q. Instructions on how to run the lab if you are using Windows NT

A. I got the GUI for Lab 1 working on my PC at IBM Poughkeepsie - perhaps it will be of use to other students as well.

To get X Windows DISPLAY (for Lab 1) from RPI rcs machines onto my PC running Windows95, I did the following things:

     1. Download & install SecureCRT (evaluation, free for 30 days) from www.vandyke.com
     2. Download & install Starnet X-Win32v4.1.1 (evaluation, free) from www.starnet.com
     3. Set up SecureCRT to connect to port 22 (ssh) of the desired machine (rcs.rpi.edu)
     3.1 In the Port Forwarding tab of the Advanced screen in the Session parameters in SecureCRT, ensure that:
          The local and remote ports are numbered 6000
          The remote server (e.g. rcs AIX machine) IP address (NOT hostname) is specified.
     4. Start the X-Win32 package
     5. Restart SecureCRT and log into the AIX machine.
     6. Obtain Lab1 as indicated, and start the GUI.



Q. Though it seems that most of the remote access problems will be solved with the porting of the frag demo to RCS, I am still confused as to how I will be able to run the GUI that requires AIX. I do NOT have access to an AIX machine at IBM since I work in S/390 (mainframes). I don't know if it helps any, but I have Red Hat Linux 5.1 on my home machine (but only have dial-up access around 28.8k). Please let me know what I can do to help resolve this situation.
 

A. The problem is not which version of UNIX you have, but more of whether your firewall allows you to export display. If it does, then it  doesn't matter if your local machine is any flavor of UNIX or any architecture as long as it has X-Windows.

Do you have firewall restrictions to your connection from home? If not, you can ssh to rcs machines and work from there.

IF you do have a firewall from your home connection, so that you can't connect from home either, you will have to get an account on a AIX or Solaris machine at IBM. You can then install the lab in that account and telnet/ssh from your existing machine. There shouldn't be any firewall problems intra-domain and hence you can run the GUI display.


Q. Can I have details of connecting to a remote machine and running the program?

A. This is information on establishing a connection to the Rensselaer Computing System (RCS) that will allow students to use X (graphical) applications from off campus.

In order to use an RCS X application you will need to have a high speed connection. Generally, Internet speeds are required.

If your system has ssh programs, you will be able to establish a connection that will allow you to run X based applications. If you are not sure if you have access to these programs or if you have internet access you will need to check with your local system administrators.

If you have a PC that is running an X emulator such as eXceed or X-Win32. You still need Internet access and eXceed or X-Win32 will allow the X setup.

Using a telephone line and dialing a local ISP will not work.
Your PC needs to be attached  directly to a high speed Internet connection.

If you are using an X capable device here are the instructions for connecting to rcs.rpi.edu.

ssh is a program that maybe installed on your local system. If so, it is designed to automatically handle the configuration.

From your system prompt enter "ssh rcs.rpi.edu" and if should be prompted for your RCS userid. If the address rcs.rpi.edu does not work. Try rcs-ibm.rpi.edu. rcs-ibm is one of the servers in the the rcs.rpi.edu group. After logging in (contact me is you need your RCS userid access) you can run any of the RCS X applications.
============
Patrick Valiquette, Academic Computing Services
e-mail - valiqp@rpi.edu, voice (518) 276-6723