Linux Scroll

Just another site

Category Archives: network

Internet Protocol Suite

Application Layer



Transport Layer


Internet Layer

IP (IPv4, IPv6) · ICMP · ICMPv6 · IGMP · IPsec ·

Link Layer

ARP/InARP · NDP · OSPF · Tunnels (L2TP) · PPP · Media Access Control (Ethernet, DSL, 


TCP = Transmission Control Protocol
IP = Internet Protocol



Internet Relay Chat (IRC) is a form of real-time Internet text messaging (chat) or synchronous conferencing.It is mainly designed for group communication in discussion forums, called channels, but also allows one-to-one communication via private message[3] as well as chat and data transfer, including file sharing.

Nmap – port scanner

Network exploration tool and security / port scanner.

$ sudo apt-get -y install nmap

Scan host:

$ nmap -v

IP address calculation

Network class:

Class A: 1 to 126; Subnetmask:; 8 bits

Class B: 128 to 191; Subnetmask:; 16 bits
Class C: 192 to 223; Subnetmask:; 24 bits
Class D: 224 to 239
Class E: 240 to 255

Bit-wise representation
n indicates a binary slot used for network ID.
H indicates a binary slot used for host ID.
X indicates a binary slot (without specified purpose)

Class A

0. 0. 0. 0 = 00000000.00000000.00000000.00000000 = 01111111.11111111.11111111.11111111
0nnnnnnn.HHHHHHHH.HHHHHHHH.HHHHHHHH n=128(27) H=16,777,216(224)

Class B
128. 0. 0. 0 = 10000000.00000000.00000000.00000000 = 10111111.11111111.11111111.11111111
10nnnnnn.nnnnnnnn.HHHHHHHH.HHHHHHHH n=16,384(214) H=65,536(216)

Class C
192. 0. 0. 0 = 11000000.00000000.00000000.00000000 = 11011111.11111111.11111111.11111111
110nnnnn.nnnnnnnn.nnnnnnnn.HHHHHHHH n=2,097,152(221) H=256(28)

Class D
224. 0. 0. 0 = 11100000.00000000.00000000.00000000 = 11101111.11111111.11111111.11111111

Class E
240. 0. 0. 0 = 11110000.00000000.00000000.00000000 = 11111111.11111111.11111111.11111111

2 Equations:

Usable Subnets = (2^n)–2 , where N = power of bits assigned

Usable Hosts = (2^n)–2 , where N = power of bits remaining

Power of N: N7  N6  N5  N4  N3  N2  N1  N0

Equal: 128 64 32 16 8 4 2 1
N = 2 bits

Networking Defination

A network device that forwards packets from one network to another. Based on internal routing tables, routers read each incoming packet and decide how to forward it.

Modem (MOdulator-DEModulator)
Until the late 1990s, the term stood for a device that allowed a computer or terminal to transmit data over a standard dial-up telephone line. Since the advent of high-speed cable and DSL connections, modem may refer to devices for low-speed dial-up or high-speed broadband.

LAN switch
A network device that cross-connects clients, servers and network devices. Also known as a “frame switch,” stand-alone LAN switches are common in all Ethernet networks.

PPPoA (Point-to-Point Protocol Over ATM)
Using the PPP dial-up protocol with ATM as the transport. Used by some DSL providers, IP packets travel from the PC over Ethernet to the DSL modem, officially known as an “ADSL transceiver unit-remote” (ATU-R). The ATU-R adds the PPP protocol to the IP packets and transports them to the carrier’s DSLAM via ATM.

PPPoE (Point-to-Point Protocol Over Ethernet)
Using the PPP dial-up protocol with Ethernet as the transport. Used by many DSL providers, PPPoE supports the protocol layers and authentication widely used in PPP and enables a point-to-point connection to be established in the normally multipoint architecture of Ethernet. A discovery process in PPPoE determines the Ethernet MAC address of the remote device in order to establish a session.

DSL (Digital Subscriber Line)
A technology that significantly increases the digital capacity of ordinary telephone lines (the local loops) into the home or office. DSL speeds are based on the distance between the customer and telco central office. There are two main categories.
Asymmetric DSL (ADSL) is used for Internet access, where fast downstream is required, but slow upstream is acceptable.
Symmetric DSL (SDSL, HDSL, etc.) is designed for connections that require high speed in both directions.

ATM (Asynchronous Transfer Mode)
A network technology for both local and wide area networks (LANs and WANs) that supports real-time voice and video as well as data. The topology uses switches that establish a logical circuit from end to end, which guarantees quality of service (QoS).

IPv6 increases the address space from 32 to 128 bits.
IPv6 is backward compatible with and is designed to fix the shortcomings of IPv4, such as data security and maximum number of user addresses.

VPN (Virtual Private Network)
A private network that is configured within a public network (a carrier’s network or the Internet) in order to take advantage of the economies of scale and management facilities of large networks. VPNs are widely used by enterprises to create wide area networks (WANs) that span large geographic areas, to provide site-to-site connections to branch offices and to allow mobile users to dial up their company LANs.

IPsec (IP SECurity)
A security protocol that provides authentication and encryption over the Internet. Unlike SSL, which provides services at layer 4 and secures two applications, IPsec works at layer 3 and secures everything in the network.

Check your IP address in command

Check your public IP:

$ wget -q -O -|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Check your local IP:

$ ifconfig | grep 'inet addr:'| grep -v '' | cut -d: -f2 | awk '{ print $1}'


Network exploration tool and port scanner.

$ sudo apt-get -y install nmap

Scan open port:

$ nmap -v

Linux basic networking

View current routing table:

$ route -n

$ netstat -rn

View arp cache:

$ arp -n

Ping only 4 packets:

$ ping -c 4

Trace Route:

$ traceroute

Trace Path:

$ tracepath

DNS Test:

$ host

Advanced DNS Test:

$ dig

DNS Reverse Lookup:

$ host

Advanced Reverse Lookup:

$ dig -x