Last updated: 25 Apr 2008
Overview of ethernet network and TCP/IP basics; selection of equipment and cables; hands-on experience creating a small LAN; connecting to the Internet; security concerns; testing network
Seven-layer OSI model
mechanisms to support end-user apps such as mail, file transfer, and web access
mechanisms for data representation within applications
mechanisms for reliable communications among cooperating applications
mechanisms for reliable end-to-end error recovery and flow control
staion to station communication across a number of links -- an internetwork or internet.
staion to station communication across one link -- transmit and receive frames/packets, recognize links, etc.
electrical, mechanical, functional control (e.g., cables, interface cards, timing)
Arbitrate access to shared communication mechanism
Id | Media Type | Mbps | Max Segment (m) | Comments |
---|---|---|---|---|
10BASE5 | thick coaxial | 10 | 500 | the original |
10BASE2 | thin coaxial | 10 | 185 | "Cheapernet" |
10BASE-T | twisted-pair (Cat 3) | 10 | 100 | very popular |
10BASE-FL | fiber optic | 10 | 2000 | most popular of original fiber |
100BASE-TX | twisted-pair (Cat 5) | 100 | 100 | Fast Ethernet; auto-negotiation (10/100) |
100BASE-FX | fiber (multi-mode) | 100 | 2000 | |
1000BASE-T | twisted-pair (Cat 5+) | 1000 | 100 | autonegotiation of speed and duplex |
1000BASE-SX | fiber (short wavelength) | 1000 | 220 | |
1000BASE-LX | fiber (long wavelength) | 1000 | 5000 | |
10GBASE-T | twisted-pair (Cat 6a+) | 10000 | 100 | full duplex; no CSMA/CD |
10GBASE-nnn | fiber, various | 10000 | various | |
100GBASE-nnn | 100000 | various | being defined now |
Repeater sends signals to all ports, and must obey round-trip timing restrictions.
Switch remembers which port is connected to what MAC address, and sends signals only to that port.
Version 4: 4-byte addresses
Version 6: 32-byte addresses
Five-layer network model:
0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 |
---|---|---|---|---|---|---|---|
Version | Header Len. | Type of Service | Total Length | ||||
Identification | Flags | Fragmentation Offset | |||||
Time to Live | Protocol | Header Checksum | |||||
Source IP Address | |||||||
Destination IP Address | |||||||
Options | Padding | ||||||
Data starts here... |
Encapsulated in media (e.g., ethernet) frame's Data field.
Broadcast IP address to find MAC address associated with it. Requests are cached; use this command to see them:
arp -a
Most common ICMP datagram sender from user's perspective. Try:
ping 128.208.250.2
0 | 16 |
---|---|
Source Port | Destination Port |
Length | Checksum |
Data starts here... |
Encapsulated in IP datagram's Data field.
0 | 4 | 8 | 12 | 16 | 20 | 24 | 28 |
---|---|---|---|---|---|---|---|
Source Port | Destination Port | ||||||
Sequence Number | |||||||
Acknowledgement Number | |||||||
Offset | Reserved | Flags | Window | ||||
Checksum | Urgent Pointer | ||||||
Options | Padding | ||||||
Data starts here... |
Encapsulated in IP datagram's Data field.
First Byte Is | Class | Network Number | Host Address |
---|---|---|---|
0..127 | A | first byte | next three bytes |
128..191 | B | first two bytes | last two bytes |
192..223 | C | first three bytes | last byte |
>223 | D | ignore | ignore |
IP: 192.168.10.20 Subnet mask: 255.255.255.0 Means: Host 20 on subnet 192.168.10.0
192.168.10.0/24
In a Windows CMD shell:
ipconfig
In a Windows CMD shell:
netsh interface ip set address name="Local Area Connection" source=static addr=10.28.250.67 mask=255.255.255.0
All of these will provide the same information: a display of the routing table. The last is Windows-specific.
netstat -nr route route print
The destination is 0.0.0.0, and the netmask (or genmask) is 0.0.0.0 with the IP address of the default gateway to the rest of the world; i.e., if no explicit route is set, use the default gateway.
Example of setting a default gateway from Windows:
route add 0.0.0.0 mask 0.0.0.0 128.208.250.100
The last value is the default gateway's IP address. Or, using netsh:
netsh interface ip set address name="Local Area Connection" gateway=10.28.250.100 gwmetric=0
To see the recognized protocols:
notepad C:\WINDOWS\system32\drivers\etc\protocol
To see listening ports on Windows:
netstat -an | findstr LISTENING
To see some of these service name to port mappings:
notepad C:\WINDOWS\system32\drivers\etc\services
netstat -an
Construct a table of name to IP mappings ("hosts" file) or consult a domain name service (DNS).
notepad C:\WINDOWS\system32\drivers\etc\hosts
127.0.0.1 localhost
netsh interface ip set dns name="Local Area Connection" source=static addr=128.95.120.1 register=NONE
Can do it with wmic and nicconfig alias.
Should set one up, but know what you want to do first.
Assign ("lease") a predefined IP address from a pool of addresses when some computer ("DHCP client") broadcasts a request for an address to any listening "DHCP Server". The server can also assign DNS servers and gateways.
Usually used together with DHCP and a private IP address pool to map one of many private addresses to one or a few public addresses, to extend the IP addresses that can be used and protect the private addresses from some external threats.
netsh interface ip set address name="Local Area Connection" source=static addr=10.208.104.m mask=255.255.0.0
netsh interface ip set address name="Local Area Connection" source=static addr=10.208.104.n mask=255.255.0.0
ipconfig /all
route add 0.0.0.0 mask 0.0.0.0 gw 128.208.247.100
route print
It won't work because you are using an unroutable IP address.
This also might work:
netsh interface ip set dns name="Local Area Connection" source=dynamic
netsh interface ip set dns name="Local Area Connection" source=static addr=128.95.120.1 register=NONE
ipconfig /all
netstat -an
netstat -an | findstr LISTENING
netstat -anob >c:\netstat.out notepad c:\netstat.out
The item in the square brackets is the service name.