12-13-2020

https://youtu.be/A7uNJFZhTro

 

 

Network

 

A Network is a collection of computers, servers, network devices, peripherals or any other device connected to one another to allow the sharing of data. Example is Internet

 

 

Basic requirement

-          NIC, Media, Topology, Protocol, IP Address

 

NIC

-          Hardware/ MAC address: 08:00:27:bd:99:25    # < ---burnt into the hard ware and you cannot change it

-          IP Address IPv4: 192.168.137.236

-          IP Address IPv6: fe80::a00:27ff:febd:9925

 

Media

-          Cables

-          RJ45 –

-          CAT5 or CAT6 etheret calbes

-          WiFI

-          HotSpots

 

Topology

 

Ring

Network Topology: 6 Network Topologies Explained [Including Diagrams]

Bus

Star

Mesh

Tree

 

Network topology definition | topologies advantages and disadvantages

-          You have a network

-          Each router you add becomes subnet

-          Max of 256 devices

-          2^8 = 2x2x2x2x2x2x2x2

 

 

Protocol

In computer world, Protocol is set of rules or procedures for transmitting data between electronic devices such as computers.

 

OSI Layers

OSI – Open Standard interconnection – 7 layer model

 

-          Physcial layer – Hardware

-          Data layer – Data Being generated

-          Network layer – working network – switches, router etc

-          Transport layer – communication is being done using serveral methods

-          Session layer – session established between two hosts

-          Presentation layer – data is presented to application

-          Application layer – exam ms office

 

TCP – Transport Control Protocol

TCP – Transport Control Protocol

-          Connection protocol

-          DATA, Network, Transport, Application – DNTA

-          Connection oriented protocol

-          TCP protocol makes 3way hanshake connection

-           

TCP makes a 3way Handshake connection established

 

what is TCP Half Open Connection and TCP half closed connection ...

Establishing Connection

-          A to B – Syncronization signal is sent

-          B to A – Syncronization signal and Acknowledgement signal

-          A to B – Acknowledgement

-          Connection is established and DATA is transferred

-          Sync – Sync AckAck

 

TCP connection Termininaiton

 

Zeltser, et al., 2005): Closing TCP connection | Download ...

Closing the connection

-          A to B – Fisinshed – complete connection

-          B to A – Acknowledge to Finish connection

-          B to A – Send the Finsh signal

-          A to B - Acknowledge the final signal

-          Fin - Fin AckAck

 

 

2^16 = 65536 ports

Exmaple

 

SSH connection is using TCP protocol and is connection oriented

 

[root@localhost ~]# netstat -anp | grep -w 22

tcp        0      0 192.168.137.20:22

 

UDP

UDP – User Datagram Protocol

-          Connection less protocol

-          Just sends the Data to the host without confirmation

-          Connection is faster

-           

Two types of UDP

Boradcast

Multicast

Network discovery using UDP Broadcast | Michiel De Mey's Blog

Signal is sent on network without confirmation

Singal is sent only the host which are part of group without confirmation

 

 

 

Differences between TCP and UDP

 

TCP

UDP

Connection oriented

Connection less

Reliable

Unreliable

Slow

Fast

SSH, HTTP, FTP, SMTP

DNS, DHCP, Broadcast

 

 

12-19-2020

https://youtu.be/NfzvBHVBD0M

 

IP Address

An Internet Protocol address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions: host or network interface identification and location addressing.

 

 

192.168.56.108

 

Computers work on Binary system – it can only recognize two digits – base 2

 

Zero = 0 = off

One = 1 = on

 

To 1, or To 0: Translating Binary in Fiction - A Writer's Journey

 

 

IP address is based on 32 binary bits structure – 2^8 octects

Information is written in Binary

 

192

168

56

108

8 bits

8 bits

8 bits

8 bit

 

Total = 32

 

 

 

2^7 = 1

 

1 bit 2^0

 

 

 

 

 

 

4 bit = nibble = 2^2

 

 

 

 

 

 

 

 

 

 

 

 

8 bit = octet = 1 byte = 2^3

 

 

 

 

 

 

 

 

 

2^0 = 1

2^1 = 2

2^2 = 4

2^3 = 8 = 1 Byte

 

 

8

7

6

5

4

3

2

1

7

6

5

4

3

2

1

0

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

128

64

32

16

8

4

2

1

 

 

 

192.168.56.108

 

192 – 11000000   #< --- right to left

 

8

7

6

5

4

3

2

1

7

6

5

4

3

2

1

0

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

128

64

32

16

8

4

2

1

192 -128

64 - 64

0 - 32

0 - 16

0 - 8

0 - 8

0 - 2

0 - 1

1

1

0

0

0

0

0

0

 

168 - 10101000

 

8

7

6

5

4

3

2

1

7

6

5

4

3

2

1

0

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

128

64

32

16

8

4

2

1

168 -128

40 - 64

40 - 32

8-16

8-8

0-4

0-2

0-1

1

0

1

0

1

0

0

0

 

56 – 00111000

 

8

7

6

5

4

3

2

1

7

6

5

4

3

2

1

0

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

128

64

32

16

8

4

2

1

56 -128

56-64

56-32

24-16

8-8

0-4

0-2

0-1

0

0

1

1

1

0

0

0

 

 

108 – 01101100

 

8

7

6

5

4

3

2

1

7

6

5

4

3

2

1

0

2^7

2^6

2^5

2^4

2^3

2^2

2^1

2^0

128

64

32

16

8

4

2

1

108-128

108-64

44-32

12-16

12-8

4-4

0-2

0-1

0

1

1

0

1

1

0

0

 

 

 192.168.56.108 = 11000000101010000011100001101100

 

 

Numbers are from right to left

 

9-0

 

Arabic numbers

 

Gateway

 

router

switch

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRfgDagFHPaFssIEaO0CfcV7WtyyW00Afo_aQ5YXG43J5B66hfQMFXpBu3HnKOMmtOWGySQFkf6&usqp=CAc

 

-          Router gives out IP address to each connected devices

-          Total maximu of 256 IP addresses are available

-          2^8 = 256

-          Each router added becomes a subnet (network in its self)

-          1 IP is reserverd for router itself

-          This reserved IP is entry point for the network to communicate with other networks

-          Reserved ip is referred to as default gateway

-           

-          [root@zmpt01 ~]# netstat -rn

-          Kernel IP routing table

-          Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

-          0.0.0.0         10.0.2.1        0.0.0.0         UG        0 0          0 enp0s9

 

Ports – connection on with a application is connected to another device

 

65,536 – ports on OS

 

Linux or Windows

 

Commonly used ports

 

Port Number

Usage

20

File Transfer Protocol (FTP) Data Transfer

21

File Transfer Protocol (FTP) Command Control

22

Secure Shell (SSH)

23

Telnet - Remote login service, unencrypted text messages

25

Simple Mail Transfer Protocol (SMTP) E-mail Routing

53

Domain Name System (DNS) service

80

Hypertext Transfer Protocol (HTTP) used in World Wide Web

110

Post Office Protocol (POP3) used by e-mail clients to retrieve e-mail from a server

119

Network News Transfer Protocol (NNTP)

123

Network Time Protocol (NTP)

143

Internet Message Access Protocol (IMAP) Management of Digital Mail

161

Simple Network Management Protocol (SNMP)

194

Internet Relay Chat (IRC)

443

HTTP Secure (HTTPS) HTTP over TLS/SSL

 

 

IP Address Classess

 

192.168.56.108

 

-          There are 4 subnets information in each ip address

-          192.168.56.108

 

192

168

56

108

-           

-          2^8 = 256 = each subnet

-           

256

256

256

256

0

0

0

0

 

256x256x256x256

4,294,967,296

Maximum for IPv4

0x0x0x0

0

2^32

-           

-          0.0.0.1 =

-          My Public IPv6 is: 2607:fb90:a345:19f9:c171:a28e:9a34:571f

-           

-          IPv6 capacity = 340,282,366,920,938,463,463,374,607,431,768,211,456

 

 

CIDR notation explained: CIDR format,CIDR table and examples - IONOS