# Chapter 1

&#x20;A **default gateway** is the [node](https://en.wikipedia.org/wiki/Node_\(networking\)) in a [computer network](https://en.wikipedia.org/wiki/Computer_network) using the [internet protocol suite](https://en.wikipedia.org/wiki/Internet_protocol_suite) that serves as the forwarding host ([router](https://en.wikipedia.org/wiki/Router_\(computing\))) to other networks when no other route specification matches the destination [IP address](https://en.wikipedia.org/wiki/IP_address) of a packet.

An **Internet Protocol address** (**IP address**) is a numerical label assigned to each device connected to a [computer network](https://en.wikipedia.org/wiki/Computer_network) that uses the [Internet Protocol](https://en.wikipedia.org/wiki/Internet_Protocol) for communication. An IP address serves two main functions: host or network interface [identification](https://en.wikipedia.org/wiki/Identification_\(information\)) ( routing ) and location [addressing](https://en.wikipedia.org/wiki/Network_address) ( addressing ).

The subnet mask 255.255.255.0 address is the most common [subnet mask](https://www.lifewire.com/internet-protocol-tutorial-subnets-818378) used on computers connected to [Internet Protocol (IPv4)](https://www.lifewire.com/internet-protocol-explained-3426713) networks. Besides its use on home network routers, you might also encounter this mask on network professional certification exams such as the [CCNA](https://www.lifewire.com/cisco-certified-network-associate-817475).

IP address shows the position of the IP on which network.&#x20;

For example :

* IP : 192.168.10.9
* Network mask : 255.255.255.0
* network address : 192.168.10.0

Personal device IP address will be different from the Google one because the personal IP address is the Private IP address and the Google one is Public IP address. Private IP address can't connect to the internet , So if they want to connect it to the Internet, They need to change their place or address.

To translate Private IP to public IP we use NAT ( Network Address Translation )

For traits that rely on one parent or centralize. The advantage is that the security of the internet can be controlled properly and the drawback is that if the parent is down, then the entire system will be affected by the parent and communication with each other will be disrupted.

For properties that rely on distributed, have no parent and everything can relate to each other. The advantage is that if one of the networks is down, then the system will not be disturbed, because it can still connect with networks that are not down and for the distributed nature is more flexible and more reliable.

The **Transmission Control Protocol (TCP)** is a transport protocol that is used on top of IP to ensure reliable transmission of packets. TCP/IP is the standard of the network, even though our devices are from different companies, our devices can still be connected to the internet.

TCP has a reliable service, the function of this TCP itself is to send packets from the source to the recipient and to ensure that the data is sent completely to the recipient, if any error occurs or the packet is  lost in the middle of the delivery process, TCP will look for the packet and send it back to the recipient until the recipient gets the complete package.

The **User Datagram Protocol (UDP)** is a lightweight data transport protocol that works on top of IP.

UDP provides a mechanism to detect corrupt data in packets, but it does _not_ attempt to solve other problems that arise with packets, such as lost or out of order packets. That's why UDP is sometimes known as the _**Unreliable**_**&#x20;Data Protocol**.

UDP is simple but fast, at least in comparison to other protocols that work over IP. It's often used for time-sensitive applications (such as real-time video streaming) where speed is more important than accuracy.

**Domain Name System** (**DNS**) is a [hierarchical](https://en.wikipedia.org/wiki/Hierarchy) and [decentralized](https://en.wikipedia.org/wiki/Decentralised_system) naming system for computers, services, or other resources connected to the [Internet](https://en.wikipedia.org/wiki/Internet) or a private network.

The example of DNS is WWW address :&#x20;

1. MAC Address ( physical address ) , it doesn't change like you ID number  , it contains 6 bytes ( 48 bits ) , The MAC Address show the manufacture and some information and we can change the MAC Address through some software and the point of changing the Mac Address is for our location can't be tracked by someone else.
2. IP Address ( logical address )
3. Port Number

Steps to debug network problem :

1. ping 127.0.0.1

* The internet is a structure composed of many protocols, the standard protocols are IP or TCP/IP.
* For IP it used to addressing and routing and for TCP it provide end to end service
* Valid IP Address is in range 0 - 255 each group.
* There are 3 places for the PC that are : 1. Wired Ethernet card , 2. Wifi Card , 3.Loopback

2\. ping Ethernet Card

3\. ping default gateway&#x20;

configuration of the host and the network IP&#x20;

4\. ping 8.8.8.8

DNS Server&#x20;

5\. ping tw.yahoo.com

If Step 4 was okay but failed in step 5 it means that the DNS have problem so we have to change or update the DNS Server .

Types of Area Network :

* A **body area network** (**BAN**), also referred to as a wireless body area network (WBAN) or a body sensor network (BSN) or a medical body area network (MBAN), is a wireless network of wearable computing devices.
* A **personal area network** (**PAN**) is a [computer network](https://en.wikipedia.org/wiki/Computer_network) for interconnecting [electronic devices](https://en.wikipedia.org/wiki/Electronic_devices) within an individual person's workspace. Wired personal area networks provide short connections between peripherals. Example technologies include [USB](https://en.wikipedia.org/wiki/USB), [IEEE-1394](https://en.wikipedia.org/wiki/IEEE-1394) and [Thunderbolt](https://en.wikipedia.org/wiki/Thunderbolt_\(interface\)). A wireless personal area network (WPAN) is a personal area network in which the connections are wireless. [IEEE 802.15](https://en.wikipedia.org/wiki/IEEE_802.15) has produced standards for several types of PANs operating in the [ISM band](https://en.wikipedia.org/wiki/ISM_band) including [Bluetooth](https://en.wikipedia.org/wiki/Bluetooth).
* &#x20;A **local area network** (**LAN**) is a [computer network](https://en.wikipedia.org/wiki/Computer_network) that interconnects computers within a limited area such as a residence, school, laboratory, university campus or office building. Wired example is Ethernet Cable , for Wireless is Wifi.
* A **metropolitan area network (MAN)** is similar to a local area network (LAN) but spans an entire city or campus. MANs are formed by connecting multiple LANs. Thus, MANs are larger than LANs but smaller than wide area networks (WAN). MANs are extremely efficient and provide fast communication via high-speed carriers, such as fiber optic cables. Example for MAN is Wimax. There are two types of MAN : Telecommunication and Data Communication .
*   &#x20;A **wide area network** (**WAN**) is a [telecommunications network](https://en.wikipedia.org/wiki/Telecommunications_network) that extends over a large geographic area for the primary purpose of [computer networking](https://en.wikipedia.org/wiki/Computer_network). Wide area networks are often established with [leased telecommunication circuits](https://en.wikipedia.org/wiki/Leased_line).

    * Wired examples are ADSL ,  cable , fiber.
    * Wireless are 4G , 5G. &#x20;

    Example of WAN internet ( Autonomous network that combined together ) are TANET , HiNet , SEEDNet.

### What is 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.[![](https://www.guru99.com/images/1/011720_0724_HubvsSwitch1.jpg)](https://www.guru99.com/images/1/011720_0724_HubvsSwitch1.jpg)

### What is a Switch?

A network switch is a computer networking device that connects various devices together on a single computer network. It may also be used to route information in the form of electronic data sent over networks. Since the process of linking network segments is also called bridging, switches are usually referred to as bridging devices.32.4M322How to write a TEST CASE Software Testing Tutorial[![](https://www.guru99.com/images/1/011720_0724_HubvsSwitch2.jpg)](https://www.guru99.com/images/1/011720_0724_HubvsSwitch2.jpg)



### Advantages of HUB

* Offers shared Internet Scalability(uplink)
* Allows Network Monitoring
* Provide backward compatibility
* Helps you to extend the total distance of the network

### Disadvantages of HUB

* It's mostly half-Duplex
* Does not offer dedicated bandwidth
* It can not select Network's Best Path.
* There is no mechanism of any kind to reduce network traffic.
* Possibility of the device differentiation
* Network size
* Security was bad&#x20;

### Advantages of Switch

Here, are pros/benefits of using Switch

* It helps you to reduce the number of broadcast domains.
* Supports VLAN's that can help in Logical segmentation of ports
* Switches can make use of CAM table for Port to MAC mapping
* Security better than Hub

### Disadvantages of Switch

Here, are cons/drawbacks of using Switch:

* Not as good as a router for limiting Broadcasts
* Communication between VLAN's requires inter VLAN routing, but these days, there are many Multilayer switches available in the market.
* Handling Multicast packets that requires quite a bit of configuration & proper designing.
* Reduces the number of Broadcast domains

Network Topology :

{% file src="https://2277444168-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mc7aa7TpYiFT5jdyFYT%2F-Mc9YhHKzlTvzIzWhWIE%2F-Mc9bQjuupZFDbXNmLD3%2FNetwork_Diagram-03-network_topologies.width-800.png?alt=media&token=4a6ed175-ee57-4375-ada9-1f062a6bbac9" %}

* &#x20;A **star network** is an implementation of a [spoke–hub distribution paradigm](https://en.wikipedia.org/wiki/Spoke%E2%80%93hub_distribution_paradigm) in [computer networks](https://en.wikipedia.org/wiki/Computer_network). In a star network, every [host](https://en.wikipedia.org/wiki/Host_\(network\)) is connected to a central [hub](https://en.wikipedia.org/wiki/Hub_\(network_science\)). In its simplest form, one central hub acts as a conduit to transmit messages. If you use a hub there will be a collision if there is too much data. The best way is to use switch with full-duplex. The security for star network is quite good , easy to control and the diagram is simple. For the disadvantage is If the parent of the star topology is damaged, the entire network will stop because it can't connect to each other.
*

    * Unicast : one to one communication
    * Multicast : one to many communication
    * Broadcast : one to everyone&#x20;


* &#x20;A **bus network** is a [network topology](https://en.wikipedia.org/wiki/Network_topology) in which [nodes](https://en.wikipedia.org/wiki/Node_\(networking\)) are directly connected to a common [half-duplex](https://en.wikipedia.org/wiki/Half-duplex) link called a [bus](https://en.wikipedia.org/wiki/Bus_\(computing\)). If we want to send goods using the bus topology, the goods must fight over bandwidth to send goods. Usually the bus topology uses a terminator, and the Ethernet cable used by the bus topology is RJ58. Bus topology is very suitable for broadcast and the drawback is that if one of these bus topology experiences interference then everything will also be disrupted and the security in this bus topology is not secured.
* &#x20;A **ring network** is a [network topology](https://en.wikipedia.org/wiki/Network_topology) in which each node connects to exactly two other nodes, forming a single continuous pathway for signals through each node – a ring. Data travels from node to node, with each node along the way handling every packet. \
  The operation mode of ring topology is quite different :
*

    * Simplex : One way transmission
    * Half-Duplex : Two way but not in the same time transmission&#x20;
    * Full-Duplex : Two way and in the same time transmission

    For the token ring is contention free , as long as you have the token you can send something. This network was not that successful because of the high prize.
* &#x20;A **tree network**, or **star-bus network**, is a hybrid [network topology](https://en.wikipedia.org/wiki/Network_topology) in which [star networks](https://en.wikipedia.org/wiki/Star_network) are interconnected via [bus networks](https://en.wikipedia.org/wiki/Bus_network).[\[1\]](https://en.wikipedia.org/wiki/Tree_network#cite_note-1)[\[2\]](https://en.wikipedia.org/wiki/Tree_network#cite_note-2) Tree networks are hierarchical, and each [node](https://en.wikipedia.org/wiki/Node_\(networking\)) can have an arbitrary number of child nodes.
* &#x20;A **mesh network** (or simply **meshnet**) is a [local network](https://en.wikipedia.org/wiki/Local_network) [topology](https://en.wikipedia.org/wiki/Network_topology) in which the infrastructure [nodes](https://en.wikipedia.org/wiki/Node_\(networking\)) (i.e. bridges, switches, and other infrastructure devices) connect directly, dynamically and non-hierarchically to as many other nodes as possible and cooperate with one another to efficiently route data from/to clients. This lack of dependency on one node allows for every node to participate in the relay of information. Mesh networks dynamically self-organize and self-configure, which can reduce installation overhead. The ability to self-configure enables dynamic distribution of workloads, particularly in the event a few nodes should fail. This in turn contributes to fault-tolerance and reduced maintenance costs.
* &#x20;**Hybrid Access Networks** refer to a special architecture for broadband access networks where two different network technologies are combined to improve bandwidth.

For the basic type is : Star , Bus and Ring Topology&#x20;

For the other one is the combination of the basics&#x20;

2 Basic types of network model :

* **Client–server model** is a [distributed application](https://en.wikipedia.org/wiki/Distributed_application) structure that partitions tasks or workloads between the providers of a resource or service, called [servers](https://en.wikipedia.org/wiki/Server_\(computing\)), and service requesters, called [clients](https://en.wikipedia.org/wiki/Client_\(computing\)).
* **Peer-to-peer** (**P2P**) computing or networking is a [distributed application](https://en.wikipedia.org/wiki/Distributed_application) architecture that partitions tasks or workloads between peers. Peers are equally privileged, equipotent participants in the application.

The **Open Systems Interconnection model** (**OSI model**) is a [conceptual model](https://en.wikipedia.org/wiki/Conceptual_model) that characterizes and standardizes the communication functions of a [telecommunication](https://en.wikipedia.org/wiki/Telecommunication) or computing system without regard to its underlying internal structure and technology. Its goal is the interoperability of diverse communication systems with standard [communication protocols](https://en.wikipedia.org/wiki/Communication_protocols).

The **International Organization for Standardization** ( **ISO** ) is an [international standard](https://en.wikipedia.org/wiki/International_standard)-setting body composed of representatives from various national [standards organizations](https://en.wikipedia.org/wiki/Standards_organization).

OSI uses ISO as the standard because ISO is more organized.

OSI 7 layers

* **Physical Layer** ,  The [physical layer](https://en.wikipedia.org/wiki/Physical_layer) is responsible for the transmission and reception of unstructured raw data between a device and a physical [transmission medium](https://en.wikipedia.org/wiki/Transmission_medium). It converts the digital bits into electrical, radio, or optical signals. Layer specifications define characteristics such as voltage levels, the timing of voltage changes, physical data rates, maximum transmission distances, modulation scheme, channel access method and physical connectors. In the wired physical layer we use an ethernet cable, in the cable it is usually decided which part or which pin is used to send and receive, or to do something. In wireless physical layer we see the frequency
* **Data Link** ,   The [data link layer](https://en.wikipedia.org/wiki/Data_link_layer) provides [node-to-node data transfer](https://en.wikipedia.org/wiki/Node-to-node_data_transfer)—a link between two directly connected nodes. It detects and possibly corrects errors that may occur in the physical layer. It defines the protocol to establish and terminate a connection between two physically connected devices. It also defines the protocol for [flow control](https://en.wikipedia.org/wiki/Flow_control_\(data\)) between them. The data link layer is often divided into two sublayers: [logical link control](https://en.wikipedia.org/wiki/Logical_link_control) (LLC)  and [media access control](https://en.wikipedia.org/wiki/Media_access_control) (MAC) to control the process of shipping goods so that there are no crashes between goods when the delivery process takes place.

Data Link use **Hop-by-hop transport** is a principle of controlling the flow of data in a network. With hop-by-hop transport, chunks of data are forwarded from node to node in a [store-and-forward](https://en.wikipedia.org/wiki/Store-and-forward) manner

* **Network Layer** , The main functionality of the network layer is to provide end-to-end connectivity. The [network layer](https://en.wikipedia.org/wiki/Network_layer) provides the functional and procedural means of transferring [packets](https://en.wikipedia.org/wiki/Network_packet) from one node to another connected in "different networks". A network is a medium to which many nodes can be connected, on which every node has an address and which permits nodes connected to it to transfer messages to other nodes connected to it by merely providing the content of a message and the address of the destination node and letting the network find the way to deliver the message to the destination node, possibly [routing](https://en.wikipedia.org/wiki/Routing) it through intermediate nodes. If the message is too large to be transmitted from one node to another on the data link layer between those nodes, the network may implement message delivery by splitting the message into several fragments at one node, sending the fragments independently, and reassembling the fragments at another node. It may, but does not need to, report delivery errors.

The 2 main process of Network Layer are Addressing and Routing&#x20;

* **Transport Layer** ,  The [transport layer](https://en.wikipedia.org/wiki/Transport_layer) provides the functional and procedural means of transferring variable-length data sequences from a source to a destination host, while maintaining the quality of service functions.

[**Quality of Service (QoS)**](https://www.paloaltonetworks.com/content/pan/en_US/documentation/80/pan-os/pan-os/quality-of-service) is a set of technologies that work on a network to guarantee its ability to dependably run high-priority applications and traffic under limited network capacity. QoS technologies accomplish this by providing differentiated handling and capacity allocation to specific flows in network traffic. This enables the network administrator to assign the order in which packets are handled, and the amount of bandwidth afforded to that application or traffic flow.

To solve the problem of packet loss, out of order , packet duplicated the transport layer uses Qos.

Packet loss can sometimes occur when packets enter too fast so they don't have time to make output and there is a buffer or queue and if the package or item is too large or too many, the package or item can be deleted

Out of order can occur if the package delivery process is via a different route so it is possible that the package that was later sent may arrive earlier than the previous package.

* **Session Layer** ,  The [session layer](https://en.wikipedia.org/wiki/Session_layer) controls the dialogues (connections) between computers. It establishes, manages and terminates the connections between the local and remote application. It provides for [full-duplex](https://en.wikipedia.org/wiki/Duplex_\(telecommunications\)), [half-duplex](https://en.wikipedia.org/wiki/Half-duplex), or [simplex](https://en.wikipedia.org/wiki/Simplex_communication) operation, and establishes procedures for checkpointing, suspending, restarting, and terminating a session. In the OSI model, this layer is responsible for gracefully closing a session. This layer is also responsible for session checkpointing and recovery, which is not usually used in the Internet Protocol Suite. The session layer is commonly implemented explicitly in application environments that use [remote procedure calls](https://en.wikipedia.org/wiki/Remote_procedure_call). In the Session layer, there is one host whose function is to remember the process that occurred before the disturbance occurred, so that if the disturbance has been corrected, the process does not have to start from the beginning again and will continue from the process where the disturbance came before.
* **Presentation Layer** ,  The [presentation layer](https://en.wikipedia.org/wiki/Presentation_layer) establishes context between application-layer entities, in which the application-layer entities may use different syntax and semantics if the presentation service provides a mapping between them. If a mapping is available, presentation protocol data units are encapsulated into session protocol data units and passed down the [protocol stack](https://en.wikipedia.org/wiki/Protocol_stack).

In Presentation Layer there are :

*
  * Encoding and Decoding , **UTF** Stands for "[Unicode](https://techterms.com/definition/unicode) Transformation Format." UTF refers to several types of Unicode [character encodings](https://techterms.com/definition/characterencoding).
*
  * Compression and Decompression&#x20;
*

    * Encryption and Decryption&#x20;


* **Application Layer** ,  The [application layer](https://en.wikipedia.org/wiki/Application_layer) is the OSI layer closest to the end user, which means both the OSI application layer and the user interact directly with the software application. This layer interacts with software applications that implement a communicating component. Such application programs fall outside the scope of the OSI model. Application-layer functions typically include identifying communication partners, determining resource availability, and synchronizing communication. When identifying communication partners, the application layer determines the identity and availability of communication partners for an application with data to transmit.&#x20;
