""

Some Basics about Internet and Home Networking

2006-10-26 Mary Nguyen Duy-Ky Nguyen, PhD

1. Number System

The number we are using daily is decimal number, there are only 10 digits to make up a number, they are 0, 1, ., 9

Computer is a digital electronic equipment. It's impossible to assign 10 electrical levels to 10 digits. It's only possible for only 2 levels, full voltage for digit 1 and no voltage for digit 0. For a 10-volt device, 10 v for 1; but 5 volt is for 1 in a 5-volt device.

That's why computer uses binary number where there are only 2 digits to make up a number, they are 0 and 1.

The number 2006 is a decimal number for this year, but its binary number is 11111010110.

It's almost impossible to read and very prone to error. That's why the hexadecimal (hex for short) number comes to rescue this problem. There are 16 digits to make up a hex number, they are 0, 1, ., 9, a, b, c, d, e, f. It's composed of 10 digits we're quite aware of and the first 6 characters in alphabetical set we're also quite aware of. Now the hex number of 2006 is 7d6, it's much easier to read than binary one, and even easier than decimal one. 

2. Internet Address

There are 3 address types used to access Internet

Domain name address, aka URL (Uniform Resource Locator), like http://www.tramhungchau.com. This address is never changed, whenever I access to this web site whenever I use this domain address;

IP (Internet Protocol) address in number format, 98.130.165.236 is IP address of tramhungchau.com. An IP address is composed of Net_ID and Host_ID. This IP address is changed once ISP (Internet Service Provider) is changed for some reason (price, service quality, .). In fact, it's very likely that the IP address is a dynamic IP address changed very frequently;

MAC address, aka Physical or Ethernet address, in number format, 00:15:e9:77:e4:c4 is MAC address of tramhungchau.com. A MAC address is composed of Vendor_ID and Device_ID. Note that hex numbers are used. This address is changed once the HW network card is changed for some reason, like the card itself is broken and replaced, the server computer is changed.

We're using domain name address to access Internet because it's never changed and easier to remember a name tramhungchau.com than a number 98.130.165.236. But IP and MAC addresses are both used to access that web site as later explained in Routing section.

Below is the process whenever you want to access tramhungchau.com,

  1.    the very first message is broadcasted to ask "who is tramhungchau.com"
  2.    DNS (Domain Name System) server responses with IP address
  3.    IP address is broadcasted to ask for MAC address. It is this very MAC address is really used to send data to a destination.  

3. Fundamentals of Routing

We should know some definitions in network literature

  1.  A host is a computer  with only 1 network connection, ie. a host is connected to only 1 network
  2.  A gateway, aka router, is also a computer, but with 2 networks connections, ie. a gateway is connected to 2 networks;

Data must go through many gateways from your PC to web site tramhungchau.com

Assume data go from host A (Src, source) to host B (Dst, destination) through gateway X and Y. Data are transferred across network along with addresses of both Src and Dst, with both MAC and IP addresses in packets.

To save typing and reading, address is implied whenever IP and MAC appear.

  1.    Packet 1 has Src (AIP, AMAC) and Dst (BIP, X1MAC). Note that Src has both IP and MAC of src A, but Dst has only IP of dst B, but MAC of dst gateway X.
  2.    Packet 2 has Src (AIP, X2MAC) and Dst (BIP, Y1MAC). Note that Src has IP of the real src A, but MAC of src gateway X. While Dst has IP of the real dst B, but MAC of dst gateway Y.
  3.    Packet 3 has Src (AIP, Y2MAC) and Dst (BIP, BMAC). Note that Src has IP of the real src A, but MAC of src gateway Y. While Dst has both IP and MAC of the real dst B.  
Remark
  1.    IP of Src and Dst are true src and dst never changed
  2.    MAC of Src and Dst are real address of physical src and dst devices
Discussion
  1.    Routing process uses both IP and MAC
  2.    Src of received data is always traceable, for example in virus case, as IP of Src and Dst are never changed and exist in all packets along the transfer path

4. Dynamic IP Address

As mention earlier, a host is connected to 1 network, but gateway is connected to 2 networks.

IP_address = Net_ID + Host_ID

There could be many hosts connected to a network identified by its Net_ID. A subnet_mask is used to extract Net_ID from an IP_address.

Using DOS window (Command Console, .), we can use command

c:\> ipconfig /all

We'll see IP address, Subnet Mask and Default Gateway, something like

Windows IP Configuration
    Host Name . . . . . . . . . . . . : DKN_WXP
    Primary Dns Suffix  . . . . . . . :
    Node Type . . . . . . . . . . . . : Unknown
    IP Routing Enabled. . . . . . . . : No
    WINS Proxy Enabled. . . . . . . . : No
 
net adapter Local Area Connection:
    Connection-specific DNS Suffix  . :
    Description . . . . . . . . . . . : Intel(R) PRO/1000 PM Network Connection
    Physical Address. . . . . . . . . : 00-13-20-73-97-E6
    Dhcp Enabled. . . . . . . . . . . : Yes
    Autoconfiguration Enabled . . . . : Yes
    IP Address. . . . . . . . . . . . : 11.1.1.3
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Default Gateway . . . . . . . . . : 11.1.1.1
    DHCP Server . . . . . . . . . . . : 11.1.1.1
    DNS Servers . . . . . . . . . . . : 11.1.1.1
    Lease Obtained. . . . . . . . . . : Saturday, October 28, 2006 9:34:13 PM
    Lease Expires . . . . . . . . . . : Sunday, October 29, 2006 12:34:13 AM
Tool completed successfully

So, using Subnet_Mask 255.255.255.0 to extract Net_ID 11.1.1 from IP_address 11.1.1.3.

Each ISP (Internet Service Provide) is assigned a Net_ID. There are a limit number of hosts connected to ISP network, but ISP may have number of customer more than number of host_ID allocated. For example, Net_ID has subnet_mask of 255.255.0.0, so up to 65536 hosts connected to the network. But it could have more than 65536 customers because it's very unlikely all customers connected to the network at the very same time. Hence, it's impossible to assign a static (unchanged) IP address to each customer PC. A dynamic (different) IP address is assigned whenever customer logs on to the network.

Notes on info above for this PC by command  ipconfig /all,

 

5. Basic TCP/IP

Internet came from a project of Department of Defense for a reliable communication even in case of broken network attacked in a nuclear war. It's known as TCP/IP (Transmission Control Protocol / Internet Protocol). Using this protocol, data are divided and sent in small packets with sequence number. The receive side puts all these packets together based on the sequence numbers in order to restore the whole data. The reliability is based on the fact that the receiver will acknowledge every packet it gets. The transmitter will retransmits missing packet, ie. it does not get acknowledge for that packet from the receiver. There are many paths from a source to a destination, like our daily traffic. A packet goes through many gateway to arrive destination. Every gateway knows what path is fine and forward a packet via that path, like a sign at a join to ask us to use or not to use any road due to construction, for example. So, as mentioned in the section on Routing, a packet must contain

In our daily life, we're using some application protocols based on this reliable transmission protocol  

  1. HTTP (Hyper Text Transfer Protocol) : to access a web site, like tramhungchau.com, using a web browser
    http://domain_name
  2. FTP (File Transfer Protocol) : to upload or download a file, like photo, SW, . using a web browser
    ftp://domain_name                               or                     ftp://ftp.domain_name
    We can get something if ti allows anonymous access. Otherwise we have to provide username and password to access
    The 2 mail protocols below are used in setting up mail SW, like Outlook Express
  3. SMTP (Simple Mail Transfer Protocol) : to send email
    We have to specify SMTP server to send an email. It's similar we want USPS, or UPS, or FedEx to deliver our mails.
  4. POP3 (Post Office Protocol version 3): to receive mail.
    We have to specify not only POP3 server, but also our user name and password to get an email.
    Otherwise stranger can read all your private emails! It's similar when we have a PO box with USPS and use a key to open the box to get mails. Otherwise anybody van get

All network transactions are based on server-client principle. Our side is a client, and the other side is server. For HTTP, the server is at the web site we're accessing, the client is the web browser we're using to access the web site.

6. Some Typical Home Networking Topology

Note that ISP assigns only 1 IP address to our connection once our PC is online.

6.1. One PC

""

6.2. More than One PC

It's very likely that we have more than 1 PC online at the same time, while we are given only 1 IP address. The only solution to this problem is to use router to create another network. As mentioned earlier that a router, aka gateway, has 2 network connections. The IPS IP is assigned to 1st connection, and the 2nd one is for a subnet with several PCs

""

7. Some Useful Network Utilities

Note that all the following utilities should be run in DOS window (command window, console window, .)

 

7.1. PING utility

The most well-known network utility could be ping. When we are unable to access an Internet destination ( website, ftp, .), it could be the server down or the network communication is broken. Nothing we can do about the former case, but for the latter case, we can use ping utility to make sure our home network connections are fine

For a web site, we use

ping yahoo.com

Pinging yahoo.com [66.94.234.13] with 32 bytes of data:
Reply from 66.94.234.13: bytes=32 time=755ms TTL=55
Reply from 66.94.234.13: bytes=32 time=555ms TTL=55
Reply from 66.94.234.13: bytes=32 time=715ms TTL=55
Reply from 66.94.234.13: bytes=32 time=811ms TTL=55
Ping statistics for 66.94.234.13:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 555ms, Maximum = 811ms, Average = 709ms

The above test is possible if we have DNS setup, otherwise the utility ping does not know what is yahoo.com.

If we do not have DNS setup, we have use IP_addr of our home router

For our home router

ping IP_addr

Normally, IP_addrr is 192.168.0.1, or 192.168.1.1, or 192.168.2.1, .

7.2. IPCONFIG utility

Another helpful network utility is ipconfig. It could be use to get all network parameters, like IPAddr of our home router. We have seen ipconfig earlier.

ipconfig /all

Windows IP Configuration
        Host Name . . . . . . . . . . . . : DKN_WXP
        Primary Dns Suffix  . . . . . . . :
        Node Type . . . . . . . . . . . . : Unknown
        IP Routing Enabled. . . . . . . . : No
        WINS Proxy Enabled. . . . . . . . : No
Ethernet adapter Local Area Connection:
        Connection-specific DNS Suffix  . :
        Description . . . . . . . . . . . : Intel(R) PRO/1000 PM Network Connection
        Physical Address. . . . . . . . . : 00-13-20-73-97-E6
        Dhcp Enabled. . . . . . . . . . . : Yes
        Autoconfiguration Enabled . . . . : Yes
        IP Address. . . . . . . . . . . . : 11.1.1.3
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 11.1.1.1
        DHCP Server . . . . . . . . . . . : 11.1.1.1
        DNS Servers . . . . . . . . . . . : 11.1.1.1
        Lease Obtained. . . . . . . . . . : Saturday, November 04, 2006 4:54:56 PM
        Lease Expires . . . . . . . . . . : Saturday, November 04, 2006 7:54:56 PM
Tool completed successfully


We then ping the router IP_addr, using data from ipconfig above

ping 11.1.1.1

Reply from 11.1.1.1: bytes=32 time<1ms TTL=127
Reply from 11.1.1.1: bytes=32 time<1ms TTL=127

Ping statistics for 11.1.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Tool completed successfully

7.3. TRACERT utility

Another interesting utility is TRACERT as it tells us know what path to reach a website

tracert yahoo.com

Tracing route to yahoo.com [216.109.112.135]
over a maximum of 30 hops:
  1    <1 ms    <1 ms    <1 ms  11.1.1.1
  2    10 ms     9 ms     9 ms  adsl-75-31-63-254.dsl.pltn13.sbcglobal.net [75.31.63.254] 
  3     9 ms    10 ms     9 ms  dist1-vlan50.pltn13.pbi.net [64.164.97.66]
  4    10 ms    21 ms    10 ms  bb1-g3-0.pltnca.sbcglobal.net [151.164.43.54] 
  5    12 ms    11 ms    12 ms  bb1-p3-0.crsfca.sbcglobal.net [151.164.190.85] 
  6    12 ms    13 ms    13 ms  ex1-p14-0.eqsjca.sbcglobal.net [151.164.41.10] 
  7    13 ms    13 ms    12 ms  asn10310-yahoo-10g.eqsjca.sbcglobal.net [151.164.248.58] 
  8    88 ms    88 ms    89 ms  so-0-0-0.pat2.dcp.yahoo.com [216.115.101.150] 
  9    88 ms    88 ms   104 ms  ge-0-0-0-p121.msr1.dcn.yahoo.com [216.115.108.11] 
 10    88 ms    88 ms    87 ms  ge7-2.bas2-m.dcn.yahoo.com [216.109.120.197]
 
 11    88 ms    88 ms    87 ms  w2.rc.vip.dcn.yahoo.com [216.109.112.135] 
 
Trace complete.
Tool completed successfully