telnet socket and tcp/ip

gojericho0gojericho0 Member Posts: 1,059 ■■■□□□□□□□
can someone help explain to me a detailed process of using a telnet socket to communicate to a unix box. This is step by step explination of how i think the process will work.

I want to telnet to a unix server from my PC at home.

telnet is the application I will be using. I know that when i use the telnet command in a DOS prompt it will set up a session with the server I want.

so when I type to telnet command does my computer contact the local DNS server which will find out what IP from other DNS servers the name of the server resolves to.

Once my computer has the destination IP address, my computer will still need the hardware address to transmit data to the server.

My computer will send a packet leaving through my gateway router and travel to the servers gateway. It will then broadcast an ARP request on the servers network. A reply will be sent back with the MAC address to the router, and the router will forward that information back to my computer so I will have both the logical and hardware address of the unix server.

My computer will then attempt to syncronize with the server telling it that a connection once to be made and data will be sent using port 23 (telnet) and the session will be started allowing me to remotely connect to the server.

I'm just trying to get a good grasp of how the whole process works since there is so much going on in the tcp/ip suite. Any feedback is much appreciated.

Thanks,

Josh

Comments

  • WebmasterWebmaster Admin Posts: 10,292 Admin
    Almost correct. My advice to you would be to always keep in mind the OSI layers...
    My computer will send a packet leaving through my gateway router and travel to the servers gateway. It will then broadcast an ARP request on the servers network. A reply will be sent back with the MAC address to the router, and the router will forward that information back to my computer so I will have both the logical and hardware address of the unix server.
    ARP is a local thing, it occurs on layer2 (sometimes referred to as a layer2/3 protocol). The other side of the router can be reached only thru a layer 3 process (routing based on IP addressing info). In other words: when your computer gets the destination IP from the DNS query, it knows (based on its own routing table) to which router (i.e. typically the default gateway) the information needs to be send to get to the destination. Your computer can't directly communicate (on layer 2) with an IP destination on the 'other side' (outside its local network) of the router. Therefore, your computer uses ARP to get the MAC address of the router, not the destination telnet server. The router will look in its routing table to see where (the IP address) traffic for the telnet server should be send to. This can be either the telnet server itself or another router along the part.

    In short, ARP is a layer 2 broadcast protocol that doesn't pass routers, hence the arp table (i.e. run arp- a on windows command prompt) shows only addresses from the local network segment.

    [quote"In my TechNotes I ]Before two stations in a network are able to communicate with each other, they must know each others physical (MAC) addresses, the Address Resolution Protocol is used to discover an IP address (layer 3) to a MAC address (layer 2). An ARP request is broadcasted on the local network to discover the MAC address of the destination host, the station with the correct MAC address responds with an ARP reply containing its IP and MAC address.[/quote]

    Also check out the following related post:
    icon_arrow.gifwww.techexams.net/forums/viewtopic.php?t=5335
  • gojericho0gojericho0 Member Posts: 1,059 ■■■□□□□□□□
    i think i understand what you are saying, but i'm still kind of confused. i'm thinking of telneting to the unix server using the diagram below:

    mycomputer-->switch-->router-->internet-->router-->switch-->unix server

    i thought my computer would have to know the unix box's mac and ip address inorder to send data.

    since arp is a broadcast and will not get forwarded outside my private network, i can only retrieve the physical address of my local router

    Knowing both the mac and ip address of the local router, the local router will be able to relay my message to the default gateway of the unix server based on ip address. Once the packet gets to the router of the unix box, that router should have the mac address of the unix box and forward my telnet to it.

    Now when the unix box recieves my telnet request does the session start using port 23? and is my computer waiting for an ACK?

    Thanks for your help, I'm just really trying to understand the big picture so i'm real comfortable for my exam :D
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    Knowing both the mac and ip address of the local router, the local router will be able to relay my message to the default gateway of the unix server based on ip address. Once the packet gets to the router of the unix box, that router should have the mac address of the unix box and forward my telnet to it.
    Exactly icon_thumright.gif
    Now when the unix box recieves my telnet request does the session start using port 23?
    You'll have to involve the OSI model again. At the router(s) between the client and the server, the information is only processed up to layer 3 (1->2->3) and than forwarded on to the next router or the unix server (3-2-1). When the unix server receives the layer 3 packets, which contain layer 4 traffic, (such as TCP ie. for Telnet) it processes the packets further up the osi model (4->5->6->7) until it reaches layer 7, which represents or interfaces with the server's telnet application.

    Apart from the basic characteristics of the 'upper layers' (appl, pres, sess) the most important to understand are the four lower layers. This goes for almost all networking exams.
  • gojericho0gojericho0 Member Posts: 1,059 ■■■□□□□□□□
    thank you very much for your help. i think i'm getting a better understanding of how it works through hypothetical situations like this. :D
    my request for telnet (ip address of unix box/port 23=session) will let the server know that i wanna set up a session with it using the telnet application and packets and pretty much up the iso model will go until the server wants to send back, then the data will be encapsalated again and broken down to layers 1-3 while making its journey back to my machine then up the model we go again.

    i think i'm ready to take this exam and have a good understanding of the theory behind all the terminology. I have it scheduled for the 30th just so I can brush up on some practice quizes (gonna buy the network+ technotes) and work on more situations to reinforce my understanding. Thanks again for your answers and this site once again is an amazing resource
Sign In or Register to comment.