Application Programming Interface (API) defines how software applications communicate with each other using request and responses. An API documentation will contains information on how developers can use and structure those request and responses. API acts as an intermediary layer that processes data transfer between systems, letting companies open their application data and functionality to external third-part developers, business partners, and internal departments withing their companies.
OpenAPI
Open API also know as public API are an open-source API that everyone can access with HTTP protocol. This API allows companies to publicly expose information and functionalities of their system and application to third parties.
Partner API
Partner API are use to connect strategic business partners. Usually developers can access these API with a Public API developer portal but the developer still requires onboarding process and login credentials to access this partners API.
Internal API
Internal API also known as private API are hidden from external users. Internal API purpose is to improve productivity and communication across different internal development teams.
Composite API
Composite API combines multiple service APIs to allow developers to access several endpoints in a single call. This type of API are useful in microservices architecture where we need to perform a single task that may require information from several different sources.
Simple Object Access Protocol (SOAP)
SOAP API enables endpoints to communicate between server and client through SMTP and HTTP with XML as the data format. SOAP API was built to easily share information between software components that runs on different environments or written in different languages. This API protocol was more popular in the past but now is less flexible compare to other types of API protocols.
Remote Procedure Call (RPC)
Remote Procedure Call (RPC) is used to call other processes on a remote systems. RPC is also know as a function call. In this protocol, clinets calls or complets a function on the remote server and the server sends the output back to the client.
There are two types of data format used in RPC API:
RPC using XML data format are older than SOAP but a much simpler and lightweight because it uses minimum bandwidth
Websocket
Websocket can be used as ‘real-time’ application that are faster and requires less overhead than REST API.Websocket supports two-way communication between client and server. This allows the server to send a callback message to connected clients therefore making it more efficient than REST API. This connection are persistent until one side closes the communication channel. Websocket uses JSON object as the data.
Representational State Transfer (REST)
REST API also known as RESTful API is the most popular and flexible found on websites today. REST API is a set of web API architectural constraints. REST API defines a set of functions such as clients can use these function to access server data. These data exhanges between clients and server uses HTTP protocol. REST API uses JSON objects to pass the data.
REST API main feature is Stateless. Stateless means that the server do not save the clients data between requests and each request is separate and unconnected.
API endpoints are the final touchpoint of an API communication. This API endpoint includes server URLS, services, and other specific digital locations from where information is sent and received between systems.
API endpoints is specific URL where an API can receive request about a specific resource on its server. Whenever client sends a request to an API on a specific URL, It will tell the server the location of a specific resource it wants to access.
Lets take a look an example API endpoint from Twitter
https://api.twitter.com/2/tweets/{id}
From that API endpoint we can retrieve the content of a specific tweet from Twitter/X. id from the endpoint is the unique identifier of the tweet. Each tweet has a unique identifier, hence we can get a specific tweet.
API endpoints are the final touchpoint of an API communication. This API endpoint includes server URLS, services, and other specific digital locations from where information is sent and received between systems.
ON PROGRESS..
ON PROGRESS..
ON PROGRESS..
Wireshark functions as both a sniffer and a packet analyzer. A sniffer serves as a measurement tool, allowing us to inspect the content flowing through a network cable or the airwaves in the case of a wireless network. Essentially, it reveals the data observed by our network card. It operates as a comprehensive packet analyzer, presenting meaningful information about the frames it encounters. As an open-source and freely available tool, Wireshark is widely employed for the examination of network traffic.
Wireshark is a significant tool for network analysis due to features like:
Wireshark's layout includes several key components:
To capture network traffic in Wireshark:
The Wireshark interface includes:
Tshark is an alternative to Wireshark for command-line interface enthusiasts, offering similar packet capturing and analyzing capabilities.
Install tshark using:
sudo apt-get install tshark
sudo tshark -h
sudo tshark -i <interface>
tshark -i <interface> -w <file-name>.pcap
tshark -r <file-name>.pcap
tshark -i <interface> -a duration:<time>
tshark -v
tshark -c <number> -i <interface>
tshark -D
tshark -i <interface> -f "<protocol>"
iPerf is a versatile and cross-platform network performance measurement tool that is free and widely used. It supports a variety of protocols including TCP, UDP, and SCTP, along with compatibility for both IPv4 and IPv6. This tool is accessible on multiple operating systems, including Linux and Windows, making it a universal solution for network diagnostics and performance optimization. Network administrators and engineers often utilize iPerf to diagnose network issues, enhance network performance, and conduct experiments.
iPerf is also effective for network stress testing, especially with the UDP protocol. To properly stress test a network, users should set the bandwidth (using the -b parameter) much higher than the network's capacity.
iPerf can be automated for network bandwidth measurements, and Python is an excellent language for this task. For using iPerf2, one can utilize the pyperf2 library (version 0.2) or create a script to execute iPerf commands and gather outputs. iPerf3 also has a Python module available for simple measurements and automation.
iPerf requires significant system resources and is theoretically capable of testing links up to 100Gbps. However, for such high-speed tests, professional traffic generators and specialized hardware are recommended.
Advantages:
Limitations:
iperf -v
iperf -s -f K
iperf -s -u
iperf -c [server IP] -r
and iperf -c [server IP] -d
iperf -c [server IP] -u -b 10m
iperf -c [server IP] -P [number of connections]
iperf -c [server IP] -m
iperf --help
Ping is a fundamental command in networking, located at /usr/sbin/ping, which sends an ICMP ECHO_REQUEST to a host or gateway to receive an ICMP ECHO_RESPONSE. This command is essential for:
Operational and connected hosts respond to the echo request. Each request includes an IP and ICMP header, a ping PID, a timeval structure, and additional bytes to complete the packet. By default, ping sends continuous echo requests until interrupted (Ctrl-C).
Ping sends a datagram each second and outputs a line for every response. It calculates round-trip times and packet loss, providing a summary upon completion. The command ends after a set timeout or upon a SIGINT signal. The Host parameter can be a valid hostname or an Internet address.
The default behavior of ping is to continuously send echo requests until interrupted (Ctrl-C). The interrupt key can be modified using the stty command.
Continual echo requests can be taxing on the system, so their repeated use should primarily be for isolating problems.
Basic ping syntax: ping [option] [hostname or IP address]
To check the status of a remote host, for example, google.com:
ping google.com
Ping "localhost" to check the local network:
ping localhost
Change time interval between ping packets using -i:
ping -i 0.5 google.com
Change ping packet size with -s:
ping -s 1000 google.com
Limit the number of ping packets using -c:
ping -c 2 google.com