CPNT-217 Mid Term Notes PDF
Document Details
Uploaded by VigilantHeliotrope1344
Southern Alberta Institute of Technology
Tags
Summary
This document covers basic computer networking concepts, including geographical classifications like PAN, LAN, CAN, and WAN. It also discusses networking components, such as hardware (end devices, intermediary devices, and communication media), switches, and routers. The document further explains standards, and organizations involved in networking standards.
Full Transcript
CPNT-217 (Mid-Term Notes) CPNT217 - 1. Basic Networking Concepts What is a Computer Network? A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each oth...
CPNT-217 (Mid-Term Notes) CPNT217 - 1. Basic Networking Concepts What is a Computer Network? A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other. These interconnections are made up of telecommunication network technologies, based on physically wired, optical, and wireless radio-frequency methods that may be arranged in a variety of network topologies. Geographical Classification of Networks Personal Area Network (PAN): o Located in a small physical range usually with 3-5 meters o Typically using technologies such as Bluetooth o E.g.- Phone, watch and headphones, all connected together wirelessly. Local Area Network (LAN) o Located in a small to medium physical area typically within 100m o Almost always Ethernet based Wired and wireless connections Using switches and access points o Home or small office network, department in larger office Campus Area Network (CAN) o Located in a medium to large physical area, multiple floors in an office building or multiple buildings o SAIT, U of C Wide Area Network (WAN) o Located in a very large physical area such as between cities or countries o Uses many different technologies such as SONET, Frame Relay, Ethernet WAN, Telephone (PSTN) o ISP networks, links between isolated locations Why is Networking important to Software Development? Applications depend on network connectivity to services and databases running on other computers. In order to create network-enabled software, developers must understand how the infrastructure, protocols, standards, and reference models in Networking operate. Networking Components Hardware End devices – Devices that allow users to work and share resources over the network. E.g., PCs, Servers, Phones, Printers Intermediary devices – Devices that operate inside the network, directing traffic from source to destination. E.g., Switches, Routers, Access Points Communications media – Types of connections used to connect the network together. E.g., Copper, Fiber Optics, Wireless (Radio frequency, satellite) Hardware – Switches and Routers Switches Routers A device that allows connections between end A device which allows network traffic to be devices within a single network forwarded from one network to another Uses MAC address to make forwarding decisions Uses IP addresses to make decisions about where to about where to send Ethernet frames send IP packets Hardware inside Switches and Routers CPU Memory I/O Executes commands given by the RAM Interfaces/Ports IOS software Accesses memory and I/O NVRAM High-end devices often have the Flash ability to add additional processors to increase performance ROM Types of RAM in Network Devices RAM – Random Access Memory NVRAM – Non-Volatile RAM Flash Memory Volatile memory stores the running Stores the startup configuration of Stores a compressed copy of the configuration of the device the device devices operating system Commonly accessed tables: Config Register Miscellaneous other files ARP Tables MAC Address tables Routing Tables Standards A standard is a document that describes the significant features of a product, service or system. Open Standards Proprietary Standards Standards which the developer makes available for use Standards developed by an entity which determines to by anyone, allowing different manufacturers to make keep control of the standard, allowing others only to equipment that will work together. use it by licensing; meaning that equipment or software from a single manufacturer will only work with other equipment or software from that same manufacturer. Open Networking Standards Organizations IANA – The Internet Assigned Numbers Authority o Responsible for the assignation of IP Addresses to Regional Numbering Authorities IEEE – The Institute of Electrical and Electronic Engineers o Responsible for the standard governing physical equipment and MAC Addresses ANSI – The American National Standards Institute o The American National Standards Institute (ANSI) oversees the creation and dissemination of various standards and measures, including business norms and standards in the United States. ITU – The International Telecommunication Union o Coordinates telecommunication operations and services throughout the world ISO – The International Organization for Standardization o Develops and publishes international standards in all technical and nontechnical fields other than electrical and electronic engineering o OSI 7-Layer Reference Model Data Network Reference Models Open System Interconnect (OSI) TCP/IP More layers allow for material to be broken Blends functions into less layers, down into smaller, easy to swallow chunks. which can be somewhat confusing. 7 layers describe the separate parts of network 4 layers describe the separate parts communications. of network communications. Purpose of layers in Network models Reduces the complexity of problems o One big problem can be broken down to several smaller, easier to solve ones Isolates problems o Engineers can work on one layer of the model without concern with (or needing to know) what happens at other layers. o Accelerates the evolution of the technology o Changes in one layer do not require changes in other layers Layered models do not define or constrain any equipment or protocols, they only provide a conceptual framework Reference Models OSI Model TCP Model PDU - Packet Data Unit The unit of information at each layer of the model is known as a Protocol Data Unit (PDU). As a PDU passes through the layers of the model it gets additional information and control fields added to its format. The process of adding extra information to PDU while passing through the model is known as Encapsulation. Rack Mounting Equipment Individual components of networks are typically mounted in 19-inch vertical racks. These racks are generally steel, and have pre-drilled mounting holes where equipment can be secured. These holes are created in a spaced pattern based on a standard depth of equipment, measured in ‘U’, which stands for Units. (1U = 1 rack unit) We can describe equipment by saying how many Us it takes up on a rack. “I have a 2U router, 4 1U switches, and 2 4U servers in my rack.” Racks come in different sizes, and can be installed in different ways. Hardware Concerns HVAC Power Air Conditioning Power Distribution Humidity Surge Protection Air Filtering UPS CPNT217 - 2. Physical Layer and Cabling Layer 1 - The Physical Layer The physical layer contains standards that define the electrical and physical specifications of the data connection. How is the hardware manufactured, connected, etc. HOPS - Physical devices that understand Bits Switches - Physical Devices that understands Frames Routers - Physical Devices that understands Packet Physical Layer Concerns: Simplex: A data connection that works in one direction only. Half-duplex: A data connection that will work in 2 directions, but only a single direction at a time. Full Duplex: A data connection that will work in 2 directions, both working simultaneously. Media Types Copper Optical Fiber Radio Frequency Twisted Pair Cables Single mode (SM) Wi-Fi (802.11) Unshielded Twisted Pair (UTP) Shieled Twisted Pair (STP) Coaxial (Legacy) Multi-mode (MM) Bluetooth (802.15) Units of Measurement In science, bandwidth is defined as the difference between the maximum and minimum frequencies in a wave form, typically measured in Hertz (Hz, cycles per second) In Networking, bandwidth is understood to mean the maximum rate at which bits can be moved. (Bitrate, bps) Another useful measurement is Throughput (or Goodput) which is the measurement of actual movement of bits through the media. Equipment and media will commonly be marked with a measurement of 'Bandwidth' with units of bps, kbps, Mbps, Gbps, etc. Twisted Pair Cables Twisted Pair cables have multiple pairs of wires and each pair is twisted separately. Networking cables (almost always) have 4 pairs. Signals are transmitted or received on a single wire pair. The twisting reduces both the radiation of noise from the pair and the reception of noise by the pair. (Created by induction on the wires.) Each pair in the cable has a different rate of twists per foot so signals radiated by one pair will not be received by another pair. (Called Crosstalk) Unshielded Twisted Pair (UTP) Shielded Twisted Pair (STP) Most common type of network cabling Each twisted pair is surrounded by a foil shield Inexpensive compared to STP, coax or optical The foil shields reduce EMI/RFI noise interference. More susceptible to noise (interference) than STP More expensive than UTP so generally only used in very noisy environments. Twisted Pair Categories The cable category defines the construction of the cable which directly impacts Bitrate. The bitrate parameters shown here are just for Ethernet which has a distance limit of 100m. (Frequencies used are different for categories) Cat 3: 10 Mbps (Ethernet) 16 MHz - typically now only found on old telephone systems Cat 5: 100 Mbps (Fast Ethernet) 100 MHz Cat 5e: 1 Gbps (Gigabit Ethernet, 1GigE, 1GbE) 100 MHz Cat 6: 1 Gbps (Gigabit Ethernet, 1GigE, 1GbE) >250 MHz Cat 6a: 10 Gbps (10GigE, 10GbE) 500 MHz Cat 7: 10 Gbps (10GigE, 10GbE) 600 MHz Cat 8: 25/40 Gbps (40GigE, 40Gbe) 2000 MHz (Depends on 8.1 or 8.2) Twisted Pair Cable Connectors RJ-45 Connector RJ-11 connector TIA/EIA 568 Standard Smaller version of RJ-45 8 pins 4 pins Most common type of UTP cable connector Phone connections (Regular and ADSL) Most RJ-45 plugs (female) will accept an RJ-11 jack RJ45 Patch Cables An RJ-45 jack (male connector) on both ends The T568 Specification has two pinout patterns o T568A and T568b Straight Through Cables o Both ends T568A OR both ends T568B o Connect unlike devices PC to Switch, Router to Switch Cross Over Cables o One end T568A, the other end T568B o Connect like devices Switch to Switch, PC to PC, Router to Router, PC to Router T568A T568b Straight Through Cross Over Both ends T568A OR both ends T568B One end T568A, the other end T568B PC - Switch, Router - Switch Switch - Switch, PC - PC, Router - Router, PC - Router Fiber Optic Cables Optical Fiber (or Fiber) conducts light. A thin tube of very clear glass about the diameter of a human hair. Capable of very high bitrates over very long distances. 1 Tbps (1000 Gbps) over 100 Km (single mode). Light is not affected by electrical noise. Fiber Optic Cable Construction Light travels through the core The cladding keeps the light within the core Multimode (MM) Single-mode (SM) 62.5 mm and 50 μm core diameters 9 μm core diameter (nominal) Shorter range (550m at 10 Gbps) Can be 8.3 to 10 mm Lower cost, short distance – 0.5-0.6 km Long range (100 Km at 1 Tbps) Use a single light stream (1310 or 1550 nm), usually Uses multiple light streams (850-1300 nm), usually generated by a laser or laser diode. generated by an LED. Outer jacket will have a yellow color, per standards. Outer jacket will be colored orange, aqua, or lime green based on Optical Mode rating. Fiber Optical Connectors Push/Pull Screw Type LC Connector- A Lucent Connector (LC) - The small FC Connector- Ferrule Connector was the first optical footprint design gives these fiber optic connectors huge fiber connector to use a ceramic ferrule. Unlike the popularity in datacoms and makes them more ideal for plastic-bodied SC and LC connector, it utilizes a round high-density applications. Many tend to move to high- screw-type fitment made from nickel-plated or stainless efficiency cabling with LC fiber connectors nowadays. steel. The FC connectors provide the choice in precision LC fiber optic connector is considered the most instruments, as well as the choice for single mode fiber. commonly-used connector at present. SC Connector - Subscriber Connector was the first ST Connector Straight Tip fiber optic connector was connector chosen for the TIA-568 standard and is a created and licensed by AT&T shortly after the arrival of snap-in connector that latches with a simple push- pull the FC type. The ST optic connector holds the fiber with motion. Due to its excellent performance, fiber optic SC a ceramic, spring-loaded 2.5mm ferrule that stays in connector remains the second most common place with a half-twist bayonet mount. They are usually connector for polarization maintaining applications. used in both long and short distance applications such as campuses and building multimode fiber applications, corporate network environments, as well as military applications. CPNT217 - 3. Data Link Layer - Switching Principles1 Data Link Layer - 2nd Layer of OSI Model There are several protocols that can be used at layer 2 to direct traffic inside of a network: Ethernet Frame Relay High-Level Data Link Control (HDLC) Multi-Protocol Label Switching (MPLS) and others Ethernet is the default Protocol at Layer 2. Any other protocol would be specified. Data Link Layer Sublayers Logical Link Control Media Access Control Communicates between the networking software Responsible for data encapsulation/de- at higher layers and the device hardware encapsulation and access to the physical media Deals with addressing, multiplexing, and Controls interaction between devices. Acknowledgment messages Provides frame synchronization IEEE 802 LAN/MAN Data Link Sublayers IEEE 802 LAN/MAN standards are specific to the type of network (Ethernet, WLAN, WPAN, etc.) The Data Link Layer consists of two sublayers. Logical Link Control (LLC) - The LLC sublayer communicates between the networking software at the upper layers and the device hardware at the lower layers. Media Access Control (MAC) - The MAC sublayer is responsible for data encapsulation and media access control. Providing Access to Media Packets exchanged between nodes may experience numerous data link layers and media transitions. At each hop along the path, a router performs four basic Layer 2 functions: 1. Accepts a frame from the network medium. 2. De-encapsulates the frame to expose the encapsulated packet. 3. Re-encapsulates the packet into a new frame. 4. Forwards the new frame on the medium of the next network segment. Data Link Layer – Frame Structure Frame Header - Data Link Header (HD) Payload o Usually upper-layer data o May include control information for the Layer 2 protocol o Encapsulates the layer 3 PDU (Packet) Frame Trailer - Data Link Trailer (TD) o Optional When present usually error-checking information Frame Header and Trailer Contents Header o Frame Start – Indicates the beginning of the frame o Addressing – Source and Destination MAC addresses o Type – Indicate protocol used at Layer 3 o Control – Shows flow control services Tailer o Error Detection – Used to determine errors in transit o Frame Stop – Indicates the end of the frame MAC Addressing Media Access Control - Every Network Interface Card (NIC) has a unique 48 bit MAC Address in hexadecimal. These addresses are also called physical addresses, they are burned into the hardware. Each MAC Address is broken into 2 sections o OUI - Organizationally Unique Identifier: 24 bits assigned to a specific manufacturer/ model by the IEEE. o Vendor Assigned ID: 24 bits unique to the specific interface Types of MAC Address Unicast Addresses Broadcast Addresses Multicast Addresses Address points to a single NIC; All hosts on the network receive the Frames with a multicast MAC consists of 24-bit OUI plus the 24-bit frame address will be received by vendor assigned ID (Interface ID) interfaces that are configured as part of the group FF:FF:FF:FF:FF:FF (All 1s in binary) When using IPv4 at layer 3, Multicast MAC addresses will begin with 01:00:5E Ethernet Frame Fields The minimum Ethernet frame size is 64 bytes and the maximum is 1518 bytes. The preamble field is not included when describing the size of the frame. Any frame less than 64 bytes in length is considered a “collision fragment” or “runt frame” and is automatically discarded. Frames with more than 1500 bytes of data are considered “jumbo” or “baby giant frames”. If the size of a transmitted frame is less than the minimum, or greater than the maximum, the receiving device drops the frame. Dropped frames are likely to be the result of collisions or other unwanted signals. They are considered invalid. Jumbo frames are usually supported by most Fast Ethernet and Gigabit Ethernet switches and NICs. Network Topologies The network topology refers to how the network nodes are connected to each other. This can be referenced in 2 ways: Physical Topology: How are the devices physically connected to each other? Logical Topology: How do the devices communicate with each other inside the network? Common Topologies Bus: Each network node connects to a common media. Wireless works as a bus topology in some respects. Ring: Each node has 2 connections, one to each of 2 neighbors. Traffic moves from source to destination in one direction through each of the intervening nodes. Star: Each node connects to a common central point, typically a switch. The most common small network topology. Mesh: o Full: Each node is connected to every other node using a point-to-point connection o Partial: Some nodes are connected to every other node, other are connected to select other nodes Forwarding Frame Moving frames inside the network Hubs and Switches o Switches work at Layer 2 of the OSI reference model o Hubs work at Layer 1. forward binary bits out of every port except the port on which the frame was received, like a broadcast frame. Frames can collide on the media, causing problems in transmission. Requires half-duplex, send or receive, not both. o Switches use a MAC address table to track which MAC address is attached to which switchport, which means that each frame can be forwarded to the specific device to which it is destined instead of flooded out every port. Can operate in full-duplex, send and receive. Filtering Frames As a switch receives frames from different devices, it is able to populate its MAC address table by examining the source MAC address of every frame. When the MAC address table of the switch contains the destination MAC address, it is able to filter the frame and forward out a single port. Collision domains A collision domain is a media segment where collisions can occur. Because a hub forwards all traffic out of every port, all media segments are considered as part of the same collision domain. A switch breaks up collision domains, because frames are sent only to the port where the destination MAC address is attached. This makes a switch more efficient, because it cuts down on collisions, making re-transmission of frames less frequent. Switch MAC Address Table A switch learns which MAC address is connected to each port by reading the source MAC address from incoming frames on the port. This MAC address/port combination gets added to the MAC address table, and refreshed over time to ensure that information in the MAC address table is accurate. The switch then uses the MAC address table to compare destination addresses against to determine which switchport to forward them out of. Some switches have a type of memory called ‘Content Addressable Memory,’ so the MAC address table may also be called the CAM table. 4 Network Layer - IPv4 and IPv61 Layer 3 – Network The Network Layer is responsible for moving traffic between networks, providing addressing for source and destination devices. Layer 3 - Protocols Appletalk IPX - Internetwork Packet Exchange Legacy Protocols HSRP - Hot Standby Router Protocol ARL - Address Resolution Protocol ICMP - Internet Message Control Protocol Dynamic Routing Protocols: o RIP - Routing Information Protocol o EIGRP - Enhanced Internal Gateway Routing Protocol o OSPF - Open Shortest Path First IPSec - Internet Protocol Security IP - Internet Protocol The Internet Protocol is responsible for addressing host interfaces, encapsulating data into datagrams... For these purposes, the Internet Protocol defines the format of packets and provides an addressing system. IPv4 IPv6 Uses 32 bits to identify source and destination network Uses 128 bits to identify source and destination and hosts. network and hosts. 232 addresses = 4.29 billion 2128 addresses = 340 trillion Trillion Trillion (3.40*1038) Address exhaustion led to private address ranges and Latest version of the Internet Protocol, represented NAT (Network Address Translation) in Hexadecimal (Base-16) IPv4 Characteristics Connectionless Best Effort Media Independent No awareness of the destination Unreliable – no guarantee of Can be carried by all L2 protocols delivery No acknowledgement it was Layer 4 (TCP) provides reliability – L2 protocol informs IP of the MTU received not IP Maximum Transmission Unit (biggest packet size) IPv4 can Fragment packet to adapt to different L2 MTUs IPv4 Packet Header Version o 4 decimal, 0100 binary TOS o Type Of Service o Priorities for QOS TTL o Time to Live o How many hopes before it is discarded? Protocol o What is the payload o Usually a layer 4 (TCP/UDP) Segment ICMP = 1, TCP=6, UDP=17 Logical Addressing IPv4 Address Subnet Mask 32-bit value which includes the network 32-bit value which indicates what portion of portion (Subnet Address) and the host portion the IPv4 address represents the network portion, and (Device or Node Address) what represents the host portion Can be represented as a dotted-decimal value, or as a CIDR prefix IPv4 Address Structure IP Addresses also referred to as Logical Addresses IPv4 addresses are 32 bits long, expressed as 4 ‘octets’ (or bytes) of 8 bits each. o 8 bits give us 28 values, or 256 (11111111) 0-255 o IPv4 addresses range from 0.0.0.0 to 255.255.255.255 The 32 bits are comprised of 2 portions: o Network portion – Indicates to which network a particular address belongs o Host portion – Indicates to which host in the network an address belongs These addresses are broken into 5 classes Class A 0.0.0.0 to 127.255.255.255 [Loopback: 127.0.0.0 to 127.255.255.255 Special Reserved Range] Class B 128.0.0.0 to 191.255.255.255 Class C 192.0.0.0 to 223.255.255.255 Class D 224.0.0.0 to 239.255.255.255 Multicast Address Range Class E 240.0.0.0 to 255.255.255.255 Experimental Address Range Private Address Ranges These private address ranges are as follows: Class A 10.0.0.0/8 Class B 172.16.0.0/12 (Default subnet mask /16) Class C 192.168.0.0/16 (default subnet mask /24) Addresses inside these ranges are not routable on public networks, so NAT uses the internal address and port number to keep track of which device inside the private network is making a connection and translates the packet’s addressing to reflect the public address of the connection. Subnet Mask The subnet mask is a mechanism that indicates what portion of the IPv4 address represents the network portion, and what represents the host portion. This can be expressed as either a dotted-decimal value, or in CIDR notation. Dotted-decimal converts to binary, which gives an indication of the boundary by the placements of 1’s and 0’s: 255.255.255.0 The section of contiguous 1’s in the subnet mask show which portion belongs to the network portion, while the 0’s show what is the host portion. The example shows that the first 24 bits are the network portion, while the last 8 bits are the host portion. CIDR shows us this more directly, by providing a prefix length in a / notation. The prefix length tells us how many bits are in the network portion. /24 shows that the first 24 bits are the network portion. /24 is equivalent to a mask of 255.255.255.0 Classful vs Classless With classful boundaries, we are referencing the number of bits in the network portion as variants of the number of octets involved. 255.0.0.0 = /8 1 byte/octet 255.255.0.0 = /16 2 bytes/octets 255.255.255.0 = /24 3 bytes/octets With classless boundaries, we can use different numbers of bits to represent the network portion, giving us greater flexibility in conserving addresses. 255.192.0.0 = /11 255.255.128 = /17 255.255.255.128 = /25 IPv4 Address Types Unicast address – Single host. Host portion of address cannot be all 1’s or all 0’s. ‘One-to-One’ Network address – Also called subnet address; Represents the entire network. Network portion is all 1’s, Host portion is all 0’s. Directed Broadcast – Network portion is all 1’s, Host portion is all 1’s. All hosts in the network will receive this packet. ‘One-to-All’ Multicast – Addresses in the Class D range. All devices belonging to multicast group will receive this packet ‘One-to-Many’. IPv4 Address Types – Special Addresses Loopback Addresses: o Reserved range of 127.0.0.0 – 127.255.255.255 o Used to indicate a host connecting to itself For testing purposes To connect internal processes to each other on a single host Typically stated as 127.0.0.1/8 APIPA – Automatic Private IP Addressing o A protocol developed by Microsoft o Allows devices unable to contact a DHCP server to self-select an address for use inside the local network (Link-Local) o Uses the address space 169.254.0.0/16 IPv6 Characteristics Connectionless Best Effort Media Independent No awareness of the destination Unreliable – no guarantee of Can be carried by all L2 protocols delivery No acknowledgement it was Layer 4 (TCP) provides reliability – L2 protocol informs IP of the MTU received not IP Maximum Transmission Unit (biggest packet size) IPv4 can Fragment packet to adapt to different L2 MTUs *IPv6 does not require NAT, all addresses are routable on public networks IPv6 Packet Header Version o 6 decimal, 0110 binary Traffic Class o Priorities for QOS Hop Limit o How many hopes before it is discarded? Flow Control o Identifies which flow a packet belongs to allowing multiple flows to operate Types of IPv6 Addresses Global Unicast – Unique address for use on public networks. Currently using addresses beginning with 2000::/3 (001 in Binary) Unique Local – Address usable only in private network spaces. Addresses begin with FD00::/8 Link Local – Unique addresses usable only inside the local network. Addresses begin with FE80::/10 Multicast – Group addresses that configured devices will receive packets on only if directed to do so. Addresses begin with FF00::/8 IPv6 Address Structure IPv6 Addresses are 128 bits long, represented by 32 Hexadecimal characters in groups of 4 (hextets) separated by colons. IPv6 does not use a subnet mask, but does include a network prefix length, which works like CIDR notation. IPv6 addresses are typically divided into 3 sections: o A 48-bit portion representing the Global Routing Prefix, o A 16-bit portion representing the Subnet ID, and Address Auto-configuration IPv6 addresses can be auto-configured in 3 different ways: SLAAC DHCPv6 with SLAAC DHCPv6 Stateless Address Auto Acquires network information from Acquires network information from Configuration: Acquires network a Dynamic Host Configuration a DHCP server; interface identifier is information (Network address, Protocol server, configures the also acquired from the DHCP server default gateway, DNS, etc) From interface identifier using the EUI-64 Router Advertisements (RA’s), method. configures the interface ID using the EUI-64 method. EUI-64 Method To auto-configure the interface ID, the EUI-64 method uses the MAC address of the interface. A 16-bit section (FFFE) is inserted between the OUI and the vender assigned number, and the seventh bit of the 64-bit value becomes inverted. This gives a unique 64-bit value for the interface ID. IPv6 Addresses IPv6 enabled interfaces can have more than one address configured at a time. Global Unicast Address Unique Local Address Link Local Address Temporary Addresses – A variation of the Global Unicast Address. Due to privacy concerns, temporary addresses can be created with random interface IDs to prevent device tracking. Devices may use both IPv4 and IPv6 addresses at the same time. Pv6 Message Types Unicast – ‘One-to-One’ Direct message from one host to another host. Multicast – ‘One-to-Many’ Message from one host to a group of other hosts. Anycast – ‘One-to-Many, Nearest’ Message from one host to a group of hosts, directed to the nearest host of that group. Non-IP Protocols Address Resolution Protocol This protocol is used to discover a MAC address when a device recognizes an IP address but has no listed MAC address. The querying device will send a broadcast into the local network, querying the device with the listed IP address. The device with that IP address will respond with a unicast message, providing their MAC address Internet Control Message Protocol Used by network devices to send/receive error messages and operational information regarding the success or failure of data transfers. It does not participate in actual data transfers, except for some applications which may use it as a testing utility. Hot Standby Routing Protocol Allows multiple routers to share the duties of default gateway for a network, providing redundancy to the devices in the network. Router interfaces inside the network will share virtual IP address and virtual MAC address. Dynamic Routing Protocols Routers exchange information about what networks they are connected to, both directly-connected and networks they have learned about through other devices. Routing Information Protocol (RIP) o Distance-Vector type of routing protocol o RIP process uses the total number of networks traversed to determine best path information. Enhanced Interior Gateway Routing Protocol (EIGRP) o Distance-Vector type of routing protocol o EIGRP uses a complex metric including bandwidth, delay, loading, reliability and MTU to determine best path to the destination. Open Shortest Path First (OSPF) Link-State type of routing protocol OSPF uses a metric called ‘cost’ which is based on a reference bandwidth, and the stated bandwidths of the network links involved in each path. The path with the lowest total cost will be added to the routing table. CPNT217 - 9. API’s and Scripting What is API? APIs are mechanisms that enable two software components to communicate with each other using a set of definitions and protocol. What does API stand for? API stands for Application Programming Interface. In the context of APIs, the word Application refers to any software with a distinct function. An Interface can be thought of as a contract of service between two applications. This contract defines how the two communicate with each other using requests and responses. Their API documentation contains information on how developers are to structure those requests and responses. What is a web API? A Web API or Web Service API is an application processing interference between a web server and web browser. All web services are APIs but not all APIs are web services. REST API is a special type of Web API that uses the standard architectural style explained above. The different terms around APIs, like Java API or service APIs, exist because historically APIs were created before the world wide web. Modern web APIs are REST APIs and the terms can be used interchangeably. How do APIs work? API architecture is usually explained in terms of client and server. The application sending the request is called the client and the application sending the response is called the server. There are four different ways that APIs can work depending on when and why they were created: SOAP APIs These APIs use Simple Object Access Protocol. Client and server exchange messages in XML. This is a less flexible API that was more popular in the past RPC APIs These APIs are called Remote Procedure Calls. This client completes a function (or procedure) on the server, and the server sends the output back to the client. WebSocket APIs A WebSocket API is another modern web API development that uses JSON object to pass data. A WebSocket API supports two-way communication between client apps and the server. The server can send callback messages to connected to clients, making it more efficient than REST API REST APIs These are the most popular and flexible APIs found on the web today. These client sends the request to the server as data. The server uses this client input to start internal functions and return output data back to the client. What are API Integrations? API integrations are software components that automatically update data between clients and servers. Some examples of API integrations are when automatic data sync to the cloud from your phone image gallery, or the time and date automatically sync on your laptop when you travel to another time zone. Enterprises can also use them to efficiently automate many system functions. What are REST APIs? REST stands for Representational State Transfer. Rest defines a set of functions like GET, PUT, DELETE, etc. that clients can use to access server data. Clients and server exchange data using HTTP. The main feature of REST API is statelessness. Statelessness means that server do not save client data between requests. Client requests to the server are similar to the URLs you type in your web browser to visit a website. The response from the server is plain data, without the typical graphical rendering of a webpage What are the benefits of REST APIs? 1. Integration APIs are used to integrate new applications with existing software systems. This increases development speed because each functionality doesn’t have to be written from scratch. You can use APIs to leverage existing code. 2. Innovation Entire industries can change with the arrival of a new app. Businesses need to respond quickly and support the rapid deployment of innovative services. They can do this by making changes at the API level without having to re-write the whole code. 3. Expansion APIs present a unique opportunity for businesses to meet their clients’ needs across different platforms. For example, maps API allows map information integration via websites, Android ,iOS, etc. Any business can give similar access to their internal databases by using free or paid APIs. 4. Ease of maintenance The API acts as a gateway between two systems. Each system is obliged to make internal changes so that the API is not impacted. This way, any future code changes by one party do not impact the other party. What are the different types of APIs? APIs are classified both according to their architecture and scope of use. Private APIs: These are internal to an enterprise and only used for connecting systems and data within the business. Public APIs: These are open to the public and may be used by anyone. There may or not be some authorization and cost associated with these types of APIs. Partner APIs These are only accessible by authorized external developers to aid business-to- business partnerships. Composite APIs These combine two or more different APIs to address complex system requirements or behaviors. How to secure a REST API? The two main ways to secure REST APIs include: Authentication tokens These are used to authorize users to make the API call. Authentication tokens check that the users are who they claim to be and that they have access rights for that particular API call. For example, when you log in to your email server, your email client uses authentication tokens for secure access. API keys API keys verify the program or application making the API call. They identify the application and ensure it has the access rights required to make the particular API call. API keys are not as secure as tokens, but they allow API monitoring in order to gather data on usage. You may have noticed a long string of characters and numbers in your browser URL when you visit different websites. This string is an API key the website uses to make internal API calls. What do you mean by scripting? To be specific, scripting is a type of coding that automates various step-by-step functions or processes. Otherwise, these instructions would need to be input individually by a developer. Other forms of coding (like CSS or HTML, to name just two examples) may tell a computer how to display a website. What is Scripting? Scripting is a way of delivering instructions to a computer (or group of computers), as with all forms of programming. The instructions in question not only tell a computer what to do but when and how to do it as well. A scripting language allows programs to be accessed and utilized by other programs, as is the case with many modern apps and computer functions. What are Scripting Languages? A scripting language is a programming language that executes tasks within a special run-time environment by an interpreter instead of a compiler. They are usually short, fast, and interpreted from source code or bytecode. Such environments include software applications, web pages, and even embedded systems in operating system shells and games. Most modern structures support these languages, which gives them a wide support while also being developed through an open-source process. Using a scripting language is preferable depending on your goals and environment. As they are a series of commands executed with no need for a compiler, they are cross-platform and do not require special software to be installed in order to run — except for a web browser, of course. There are pros and cons to using this type of programming language, as well as the right scenario for each option in this field. It is important to learn their differences and applications before starting any project in which you might use them. Types of Scripting Languages Server-side scripting language The term server-side scripting language refers to those that run off a web server. Since it performs from the back-end side, the script is not visible to the visitor. Because of that, it is a more secure approach. They are often used to create dynamic websites and platforms, handle user queries, and generate and provide data and others. A famous example of server-side scripting is the use of PHP in WordPress. Examples: PHP, Python, Node.js, Perl, and Ruby. Client-side scripting language Unlike server-side languages, client-side scripting languages run off the user’s browser. It is usually performed at the front- end, which makes it visible to visitors and makes it more vulnerable to exploits and leaks. As such, it is often used to build user interfaces. Since the script runs locally, it usually provides better performance and, therefore, does not strain your server. Examples: HTML, CSS, jQuery, and JavaScript.