Internal to Internal Connection

Data that travels over the air and how to protect (or decipher) it

Internal to Internal Connection

Post by 193zaitsev on Thu May 22, 2008 9:10 pm
([msg=3059]see Internal to Internal Connection[/msg])

I've recently been working a lot with network programming and I am confused/curious about something.

Say you had two networks connected via internet as seen below with significant labels and IPs provided

Boxes = Routers with external IPs
Rectangles = PCs with internal network IPs

Code: Select all
     192.168.0.1                                                       172.16.0.1
     -----------                                                       -----------
    |     A    | -------                                           ----|    B    |
     -----------       |    ------------           -----------    |    -----------
                       |____|           |         |           |___|
     -----------            | ROUTER A  |         | ROUTER B  |        -----------
    |           | ----------|           |---------|           |--------|    C    |
     -----------        ____| 12.34.5.7 |         | 98.87.6.4 |___     -----------
                       |    |           |         |           |   |
     -----------       |    ------------           -----------    |    -----------
    |           |-------                                          -----|         |
     -----------                                                       ----------


Say computer A wants to connect to computer B (Ex: computer B puts up a game server and A must enter B's IP address to connect).
B opens port 8888 to listen for A's initial packet.
A, hoping to connect to B, sends a packet to 98.87.6.4:8888, Router B, the external address.
When the packet arrives at Router B, how does it know which computer the packet should be forwarded to?

Normally the Ethernet, or lowest level frame/packet, header contains the MAC address for the PC the packet is sent to but seeing as computer A doesn't know B's MAC address it can't fill in that field and Router B does not know what system the packet was originally destined for, how is the destination MAC address filled in?

I tried to word this best I could, I hope it's understandable what I'm asking
193zaitsev
New User
New User
 
Posts: 36
Joined: Wed May 21, 2008 10:28 pm
Location: USA
Blog: View Blog (0)


Re: Internal to Internal Connection

Post by Felipe the Ant on Fri May 23, 2008 11:06 pm
([msg=3120]see Re: Internal to Internal Connection[/msg])

Look into port forwarding

Forward port 8888 on router B to computer B, it sends everything on port 8888 to computer B.
Felipe the Ant
New User
New User
 
Posts: 5
Joined: Mon May 19, 2008 8:44 pm
Blog: View Blog (0)


Re: Internal to Internal Connection

Post by 193zaitsev on Fri May 23, 2008 11:25 pm
([msg=3125]see Re: Internal to Internal Connection[/msg])

Ok, thanks, that makes sense now.

New, somewhat related question.

Say the computer A is a web server that's has port 80 forwarded to it and computer B is running a web browser. When the browser connects to router A port 80 the packets are forwarded to the web server on computer A. But when the web server returns the HTTP packets to computer B, how does Router B know those packets should be returned to computer B? Does Router B keep up with what computer sent what message so it know who to return the replies to?
193zaitsev
New User
New User
 
Posts: 36
Joined: Wed May 21, 2008 10:28 pm
Location: USA
Blog: View Blog (0)


Re: Internal to Internal Connection

Post by 193zaitsev on Mon May 26, 2008 10:43 am
([msg=3254]see Re: Internal to Internal Connection[/msg])

Never mind the question now, I have just found the answer.

To anyone interested, router A, using NAT, creates a temporary dynamic translation table entry for this connection and thus reroutes response back to the browser.

the TCP/IP guide had a good section on it:
http://www.tcpipguide.com/free/t_IPNetw ... otocol.htm
193zaitsev
New User
New User
 
Posts: 36
Joined: Wed May 21, 2008 10:28 pm
Location: USA
Blog: View Blog (0)



Return to Networking

Who is online

Users browsing this forum: No registered users and 0 guests