A computer network is a set of devices connected through links. A node can be a computer, printer, or any other device (for example PLCs) capable of sending or receiving the data to and from the network. Most devices are connected via LAN (local area network). Each LAN can be connected and creates a wider network called WAN.

 

Hub :

A Hub is a networking device that allows you to connect multiple PCs to a single network. It is used to connect segments of a LAN. A hub stores various ports, so when a packet arrives at one port, it is copied to various other ports. Hub works as a common connection point for devices in a network. 

 

Router : 

A router is basically a device or hardware which is responsible for receiving, analyzing, and forwarding the data packets to other networks. A router actually determines the destination or the target IP address of the packet and thus the best way for transferring the packet is determined by the help of forwarding tables and headers. 

The forwarding of the data packet is done from one router to the other which basically forms a network(example: internet) until it reaches the final target node. A router is mainly used in the local area network(LAN) and wide area network(WAN) domain. The data is transferred across the network by using the routing protocols. It is much more costly in comparison to other network devices like the hub, switch, etc. 

Some of the companies that develop routers are D-Link, Cisco, Nortel, etc. 

Gateway : 

A gateway is basically a device or hardware which acts as a “gate” among the networks. Thus it can also be defined as a node that acts as an entrance for the other nodes in the network. It is also responsible for enabling the traffic flow within the network. Gateway uses more than one protocol for communication thus its activities are much more complex than a switch or a router. 

So a gateway is basically a device that is used for communication among the networks which have a different set of protocols and is responsible for the conversion of one protocol into the other. For any kind of workplace, the gateway is a computer system that is responsible for routing the traffic from the main workstation to the outside network. For homes, it is responsible for giving access to the internet thus acting as an internet service provider. 

 

Windows Network Diagnostic Commands

The following are common Microsoft Windows network commands

ipconfig

Ipconfig is a Console Command which can be issued to the Command Line Interpreter (or command prompt) to display the network settings currently assigned to any or all network adapters in the machine. This command can be utilized to verify a network connection as well as to verify your network settings.

netstat

Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, netstat displays active TCP connections.

tracert

When you connect to a remote device, your requests travel through a series of different routers, called hops, before they make it to their ultimate destination.

If you are finding that your connection to a remote server is slow, you can use the tracert command to check which router along the way is slow.

The tracert command is used to visually see a network packet being sent and received and the number of hops required for that packet to get to its destination.

Users with Microsoft Windows 2000 and Windows XP who need additional information network latency and network loss should also consider using the path

C:\Users\hemelix>tracert www.google.com
Tracing route to www.google.com [2a00:1450:4026:802::2004]
over a maximum of 30 hops:
  1    <1 ms    <1 ms    <1 ms  dzp5v66txfx--9z3pnk-4.rev.dnainternet.fi [2001:14bb:a3:331d:6a13:24ff:fed2:ec5a]
  2    52 ms     *       42 ms  2001:14b8:1040:312::5
  3    29 ms    14 ms    13 ms  hel6-dr3.dnaip.fi [2001:14b8:1040:312::1]
  4     *        *        *     Request timed out.
  5    57 ms    34 ms    64 ms  2001:4860:1:1::2305
  6    27 ms    18 ms    41 ms  2001:4860:1:1::2304
  7    32 ms    19 ms    38 ms  2a00:1450:8064::1
  8    30 ms    15 ms    13 ms  2001:4860:0:1::43dc
  9    26 ms    14 ms    13 ms  2001:4860:0:1::43e1
 10    44 ms    21 ms    15 ms  hem09s02-in-x04.1e100.net [2a00:1450:4026:802::2004]
Trace complete.

 

 

ping command.

ping

Helps in determining TCP/IP Networks IP address as well as determine issues with the network and assists in resolving them.

pathping

Provides information about network latency and network loss at intermediate hops between a source and destination. Pathping sends multiple Echo Request messages to each router between a source and destination over a period of time and then computes results based on the packets returned from each router.

Example,

pathping www.google.com

telnet

If your Internet appears to be working correctly, but you have issues connecting to a particular website or service, you can use the Telnet command to check if that service is running on the remote host.Telnet allows users to remotely access another computer such as a server, network device, or another computer. With telnet, users can connect to a device or computer, manage a network device, set up a device, transfer files, etc.

For example, if you are want to check if a web server is listening on www.google.com, you can use the telnet www.google.com 443 command to connect to the webserver on port 443.

telnet www.google.com 443

When a server is running on a remote computer, it will listen on certain TCP ports, which you can Telnet to, and see if you can connect to the service. If the command does not work then 

=> Control panel, Program and Features, Turn Windows featureson or off, enable Telnet Client

Service NameTCP Port
FTP21
SSH22
HTTP80
HTTPS443

FTP

FTP is short for File Transfer Protocol, this page contains additional information about the FTP command and help using that command in Unix and MS-DOS (Windows).

route

The function and syntax of the Windows ROUTE command are similar to the UNIX or Linux route command. Use the command to manually configure the routes in the routing table.

arp

Displays, adds and removes arp information from network devices.

nslookup

Displays information that you can use to diagnose Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The Nslookup command-line tool is available only if you have installed the TCP/IP protocol. See, how to use the comand.

C:\Users\hemelix>nslookup www.google.com
Server:  internet.provider
Address:  fe80::6a13:24ff:fed2:ec5a
Non-authoritative answer:
Name:    www.google.com
Addresses:  2a00:1450:4026:802::2004
          216.58.209.164

 

nbtstat

MS-DOS utility that displays protocol statistics and current TCP/IP connections using NBT.

netsh

One common way of using netsh is to reset the TCP/IP in Windows 2k/XP

Type this in Run or DOS Window – “netsh int ip reset”

In Windows XP you can run graphical diagnostics by typing “netsh diag gui” into the Run dialogue box. (This may take a little time to startup)

getmac

DOS command is used to show both local and remote MAC addresses. When run with no parameters (ie. getmac) it displays MAC addresses for the local system. When run with the /s parameter (eg. getmac /s \\foo) it displays MAC addresses for the remote computer. When the /v parameter is used, it also displays the associated connection name and network adapter name.

Find All Active/Used IP Addresses on Your Network

There is a really neat way that you can quite easily find all active/used IP Addresses on your network without the need for any third-party applications or worse, pinging each IP Address individually.

Open the Command Prompt and type in the following:

FOR /L %i IN (1,1,254) DO ping -n 1 192.168.10.%i | FIND /i “Reply”>>c:\ipaddresses.txt

Change 192.168.10 to match your own network.

Ping Command

ipconfig Command

Hostname Command

getmac Command

arp Command

NSlookup

Nbtstat

Netstat Command

tracert www.hemelix.com

Netsh is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running.

IPv4 Classes

In the IPv4 IP address space, there are five classes: A, B, C, D and E. Each class has a specific range of IP addresses (and ultimately dictates the number of devices you can have on your network). Primarily, class A, B, and C are used by the majority of devices on the Internet. Class D and class E are for special uses.

Class A Public & Private IP Address Range

Class A addresses are for networks with large number of total hosts. Class A allows for 126 networks by using the first octet for the network ID. The first bit in this octet, is always zero. The remaining seven bits in this octet complete the network ID. The 24 bits in the remaining three octets represent the hosts ID and allows for approximately 17 million hosts per network. Class A network number values begin at 1 and end at 127.

Public IP Range: 1.0.0.0 to 127.0.0.0

First octet value range from 1 to 127

Private IP Range: 10.0.0.0 to 10.255.255.255 

Subnet Mask: 255.0.0.0 (8 bits)

Class B Public & Private IP Address Range

Class B addresses are for medium to large sized networks. Class B allows for 16,384 networks by using the first two octets for the network ID. The first two bits in the first octet are always 1 0. The remaining six bits, together with the second octet, complete the network ID. The 16 bits in the third and fourth octet represent host ID and allows for approximately 65,000 hosts per network. Class B network number values begin at 128 and end at 191.

Public IP Range: 128.0.0.0 to 191.255.0.0

First octet value range from 128 to 191

Private IP Range: 172.16.0.0 to 172.31.255.255 

Subnet Mask: 255.255.0.0 (16 bits)

Class C Public & Private IP Address Range

Class C addresses are used in small local area networks (LANs). Class C allows for approximately 2 million networks by using the first three octets for the network ID. In a class C IP address, the first three bits of the first octet are always 1 1 0. And the remaining 21 bits of first three octets complete the network ID. The last octet (8 bits) represent the host ID and allows for 254 hosts per network. Class C network number values begins at 192 and end at 223.

Public IP Range: 192.0.0.0 to 223.255.255.0

Private IP Range: 192.168.0.0 to 192.168.255.255 

Special IP Range: 127.0.0.1 to 127.255.255.255 

Subnet Mask: 255.255.255.0 (24 bits)

We have the following private IP address for our usage:

Class A: 10.0.0.0 — 10.255.255.255

Class B: 172.16.0.0 — 172.31.255.255 

Class C: 192.168.0.0 — 192.168.255.255 


VPN

More coming soon..

TLS X.509 Certificates

=> https://www.youtube.com/watch?v=kAaIYRJoJkc

=> https://www.youtube.com/watch?v=Z81jegMCrfk

=> https://www.youtube.com/watch?v=5lYQRuzdZr0

Industrial communications protocol

Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix