Pages

Tuesday, February 4, 2014

Lab #1

2)

Here I decided to trace www.bing.com with ip address of (204.79.197.200) which is located in the U.S from school.

  • The first hop was sending packets to the router with an ip address of 172.16.20.1. The first response time was 1.506 ms, the second was 1.122 ms and lastly 0.925 ms. 
  • The second hop sent packets to 172.16.20.1 with the response times of 2.263 ms, 2.335 ms, and 2.317 ms, respectively. 

The rest of the hops (all to the way to 64-which is the max hops) were all timed out which means that it found a server that wasn't responding and couldn't send the packets there or another kind of error has occured.




Here I decided to trace www.dominos.com with ip address of (205.218.22.11), which is located in the Chesterfield, Missouri, from school.

  • The first hop was sending packets to the router with an ip address of 172.20.0.1. The first response time was 40.063 ms, the second was 1.045 ms and lastly 41.996 ms. 
  • The second hop sent packets to 172.16.20.1 with the response times of 3.312 ms, 41.236 ms, and 42.852 ms, respectively. 
The rest of the hops (all to the way to 64-which is the max hops) were all timed out just like the first trace.

3)

Here I decided to trace www.bing.com with ip address of (205.218.22.11), which is located in the U.S, from home.

  • The first hop was from my home router with an ip address of 192.168.1.1. The first time was 7.940 ms, the second was 8.375 ms, and the third and last was 9.075 ms. 
  • The second hop was timed out. 
  • The third hop was from the router with an ip of 67.59.228.189(Bethpage, NY). The first response time was 22.740 ms, the second was 13.867 ms and lastly 19.789 ms. 
  • The fourth hop was from the router rtr4-ge1-1.mhe.hcvlny.cv.net with an ip of 67.83.222.5(Leland, North Carolina) with the response times of 30.277 ms, 24.088 ms, and 15.639 ms, respectively. 
  • The fifth hop was from the router 451be07d.cst.lightpath.net with an ip of 65.19.99.125(Bethpage, NY). The time it took for the first round trip of packets being sent from my pc to the router and back was 26.550 ms. The second trip was from a different ip of 65.19.107.117(Arlington Heights, Illinois) with a time of 22.786 ms, and lastly 27.409 ms.
  • The sixth hop was from the router with an ip of 64.15.0.218(Bethpage, NY). The first time was 28.074 ms, the second was 28.738 ms, and the third and last was 28.393 ms. 
  • The seventh hop was time out.
  • The eight hop was from the router tor.nyc.msedge.net with an ip of 131.253.32.50(Redmond, WA). The response times were: 49.535 ms, 98.748 ms, and the last one timed out.

The rest of the hops (all to the way to 64-which is the max hops) were all timed out.


Here I decided to trace our 461 blog, www.sjcs461.blogspot.com, with ip address of (74.125.226.234), which is located in the Mountain View, California, from home.

  • The first hop was from my home router with an ip address of 192.168.1.1. The first time was 3.031 ms, the second was 8.985 ms, and the third and last was 5.292 ms. 
  • The second hop was timed out. 
  • The third hop was from the router with an ip of 67.59.228.181(Bethpage, NY). The first response time was 12.551 ms, the second was 19.326 ms and lastly 19.934 ms. 
  • The fourth hop was from the router rtr3-ge2-1.mhe.hcvlny.cv.net with an ip of 67.83.222.9(Sping Valley, NY) with the response times of 30.191 ms, 18.757 ms, and 29.864 ms, respectively. 
  • The fifth hop was from the router 451be07d.cst.lightpath.net with an ip of 65.19.99.125(Bethpage, NY). The time it took for the first round trip of packets being sent from my pc to the router and back was 30.187 ms. The second trip was from 451be06d.cst.lightpath.net with an ip of 65.19.107.109(Bethpage, NY) with a time of 26.556 ms, and lastly it went to 451be07d.cst.lightpath.net with an ip address of 65.19.107.125(Bethpage, NY) with a time of 28.560 ms.
  • The sixth hop was from the router 451be0ce.cst.lightpath.net with an ip of 65.19.120.206(Bethpage NY). The first time was 18.747 ms, the second was from the router 451be0c2.cst.lightpath.net with an ip of 65.19.120.194(Bethpage, NY) and a time of 12.685 ms. The last one was from the router 451be0ce.cst.lightpath.net with an ip of 65.19.120.206(Bethpage, NY) and a time of 28.628 ms.
  • The seventh hop was from a router with an ip of 74.125.51.221(Mountain View, CA) with the first time of 19.452 ms. Then it went to the router with an ip of 72.14.212.17(The Dalles, OR) with the times: 22.340 ms, and 28.745 ms, respectively. 
  • The eighth hop was from the router with an ip of 72.14.239.248(Mountain View, CA). The response times were: 20.381 ms, 18.935 ms, and the last one was 13.891 ms.
  • The ninth hop was from the router with an ip of 72.14.239.252(Mountain View, CA) with the response times of 19.438 ms, 17.639 ms, and 25.237 ms, respectively. 
  • The tenth hop was from the router lga15s29-in-f10.1e100.net with an ip of 74.125.226.234(Mountain View, CA) with the response times of 26.690 ms, 26.282 ms, and 22.896 ms, respectively. 
4)

Header: <sys/socket.h>

int bind(
  SOCKET s,
  const struct sockaddr FAR* name,
  int namelen
); This function associates a local address with a socket.

Takes three parameters.
1)  s - [in] Descriptor identifying an unbound socket.
2)  name - [in] Address to assign to the socket from the sockaddr structure.
3)  namelen - [in] Length of the value in the name parameter.

·      If no error occurs, this function returns zero. If an error occurs, it returns SOCKET_ERROR

int listen(
  SOCKET s,
  int backlog
); This function places a socket at a state where it is listening for an incoming connection

Takes two parameters.
1)    s- [in] Descriptor identifying a bound, unconnected socket.
2)    backlog - [in] Maximum length of the queue of pending connections. If backlog is set to SOMAXCONN, the underlying service provider responsible for socket s will set the backlog to a maximum reasonable value. There is no standard provision to obtain the actual backlog value.

·      If no error occurs, this function returns zero. If an error occurs, a value of SOCKET_ERROR is returned

SOCKET accept(
  SOCKET s,
  struct sockaddr FAR* addr,
  int FAR* addrlen
); This function permits an incoming connection attempt on a socket.

Takes three parameters.
1)   s - [in] Descriptor identifying a socket that has been placed in a listening state with the listen function. The connection is actually made with the socket that is returned by this function.
2)   addr - [out] Optional pointer to a buffer that receives the address of the connecting entity, as known to the communications layer. The exact format of the addr parameter is determined by the address family established when the socket was created.
3)   addrlen - [out] Optional pointer to an integer that contains the length of addr.

·      If no error occurs, this function returns a value of type SOCKET, but If an error occurs, a value of INVALID_SOCKET is returned

int send(
  SOCKET s,
  const char FAR* buf,
  int len,
  int flags
); This function sends data on a connected socket.

Takes four parameters.
1)    s - [in] Descriptor identifying a connected socket
2)    buf - [in] Buffer containing the data to be transmitted.
3)    len - [in] Length of the data in the buf parameter.
4)    flags - [in] Indicator specifying the way in which the call is made.

·      If no error occurs, this function returns the total number of bytes sent, which can be less than the number indicated by len for nonblocking sockets. If an error occurs, a value of SOCKET_ERROR is returned

int recv(
  SOCKET s,
  char FAR* buf,
  int len,
  int flags
); This function receives data from a connected socket.

Takes four parameters.
1)    s - [in] Descriptor identifying a connected socket.
2)    buf - [in] Buffer for the incoming data.
3)    len - [in] Length of the buf parameter.
4)    flags - [in] Flag specifying the way in which the call is made.

·      If no error occurs, this function returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. If an error occurs, a value of SOCKET_ERROR is returned



int closesocket(
  SOCKET s
); This function closes an existing socket.

Takes one parameter.
1)    s - [in] Descriptor identifying the socket to close.

·      Header: <unistd.h>
·      If no error occurs, this function returns zero. If an error occurs, a value of SOCKET_ERROR is returned


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.