Friday, 31 March 2023

Reason to have both IP and MAC addresses?

As we already had the IP address to communicate a computer to the internet, why do we need the MAC address? The answer to this question is that every mac address is assigned to the NIC of a hardware device that helps to identify a device over a network.
When we request a page to load on the internet, the request is responded to and sent to our IP address.
Both MAC and IP addresses are operated on different layers of the internet protocol suite. The MAC address works on layer 2 and helps identify the devices within the same broadcast network (such as the router). On the other hand, the IP addresses are used on layer 3 and help identify the devices on different networks.
We have the IP address to identify the device through different networks, but we still need a MAC address to find the devices on the same network.

Friday, 24 March 2023

Summary characteristic of the industry network (ModBus, Profibus, Profinet, EtherCAT, and Ethernet)

These industrial communication protocols are used in the automation industry to connect  different devices and systems.

 ModBus  

What is MODBUS? 

Modbus is a serial communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs). Modbus has become a de facto standard communication protocol and is now a commonly available means of connecting industrial electronic devices.

What is it used for?  

Modbus is typically used to transmit signals from instrumentation and control devices back to a main controller or data gathering system. 

Modbus is typically used to transmit signals from instrumentation and control devices back to a main controller or data gathering system.

For example, a system that measures temperature and humidity and communicates the results to a computer.

Modbus is often used to connect a supervisory computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems.

Versions of the Modbus protocol exist for serial lines (Modbus RTU and Modbus ASCII) and for Ethernet (Modbus TCP). 


 How does it work?

Modbus is transmitted over serial lines between devices. The simplest setup would be a single serial cable connecting the serial ports on two devices, a Master and a Slave.


The data is sent as a series of ones, and zeroes called bits. Each bit is sent as a voltage. Zeroes are sent as positive voltages and ones as negative. The bits are sent very quickly. A typical transmission speed is 9600 (bits per second).



Communication between ModBus device:

MODBUS devices communicate using a master-slave technique in which only one device (the master) can initiate transactions (called queries).

The other devices (slaves) respond by supplying the requested data to the master.

A slave is any peripheral device (I/O transducer, valve, network or other measuring device), which processes information and sends its output to the master.

Masters can address individual slaves, or can initiate a broadcast message to all slaves.


ModBus frames:

The messages exchanged between the master and the slave are called frames.

There are two types of Modbus frames: Protocol Data Unit (PDU) and Application Data Unit (ADU).

The PDU frames: function Code+ data.

The ADU frames: Add+FC+data+Error check.

The FC -> action to perform and the data -> information to be used for this action.

Profibus 

What is PROFIBUS?

PROFIBUS (Process Field Bus) is a fieldbus which is being used for high speed cyclic data communication in the world of automation. PROFIBUS has two different applications:

  • Factory automation
  • Process automation

For each application PROFIBUS can use a different protocol. PROFIBUS DP (Decentralized Peripherals) is the high-speed version, which is mostly used for factory automation (i.e. logistics, production areas, etc). PROFIBUS PA (Process Automation) is mostly used in industries such as water treatment, oil, gas, chemicals, etc. 

PROFIBUS PA runs at a fixed transmission speed of 31.25 kbps, where PROFIBUS DP can be configured to run at a maximum speed of 12 Mbps.

PROFIBUS communication is half duplex, which means that only one device is communicating at the time. PROFIBUS DP is based on the RS485 protocol and PROFIBUS PA is based on the MBP-IS protocol, which is a bus-powered protocol.

PROFIBUS DP networks are most commonly installed as a large daisy chain, creating a fault sensitive network. PROFIBUS PA can either be wired as a daisy chain or as a star topology, but by using intelligent/advanced junction boxes, PROFIBUS PA can also be installed as a ring topology. 

Profinet 

What is PROFINET?

PROFINET is a fieldbus system which is based on Ethernet. PROFINET is one of the many industrial ethernet systems out there, which is often compared to PROFIBUS.


PROFINET is a full duplex system. PROFINET networks are often designed as a star topology, or as several stars branching off a large ring backbone by using managed PROFINET switches. Because it’s ethernet based, PROFINET can operate on a much higher transmission speed than PROFIBUS.

With PROFINET, the cycle times are also adjustable for each device, whereas PROFIBUS has a fixed cycle time. PROFINET is applied in a wide variety of industries, such as automotive, oil and gas, logistics, etc.

EtherCAT 

What is EtherCAT?

EtherCAT uses the same physical and data link layers as Ethernet.

With EtherCAT, the master sends data, possibly only a single frame for the entire node network that will pass through each node.

The master is the boss and is the only node allowed to send a frame. The frame is then forwarded, downstream, by each node in the network. This approach helps to assure real-time operation and avoids delays.

EtherCAT networks do not require external switches in the network.

Each EtherCAT device typically has two Ethernet ports, the first port being the receiving port or previous node’s cable and the second port connected to the next node in the network. 

Another advantage of EtherCAT comes in the form of network topology. Many of the different network topologies may be used within an EtherCAT network. Because it utilizes Ethernets full duplex layers, the EtherCAT slave will automatically return the frame, to the master, with an open port detected downstream, essentially, self-terminating.


 EtherCAT’s Network Topology: Star, Tree, Line, Bus.

Ethernet 

What is the function of Ethernet in PLC?

Ethernet enables devices to communicate with each other via a protocol, which is a set of rules or common network language. Ethernet describes how network devices format and transmit data so other devices on the same LAN or campus network can recognize, receive and process the information.

Ethernet is a wired system that started with using coaxial cable and has successfully progressed to now using twisted pair copper wiring and fiber optic wiring.


Wednesday, 22 March 2023

Packet Tracer - Secure Shell (SSH) configuration on a router

Packet Tracer - Secure Shell (SSH) configuration on a router 

Welcome to this tutorial! Here, we’ll have an overview of the Secure Shell (SSH) protocol, then see how to configure it on a router in Packet Tracer.

An overview of SSH

Secure Shell, just like Telnet, enables a user to access a remote device and manage it remotely. However, with SSH, all data transmitted over a network (including usernames and passwords) is encrypted and secure from eavesdropping.

SSH is a client-server protocol with an SSH client and an SSH server. The client machine (such as a PC) establishes a connection to an SSH server running on a remote device (such as a router). Once the link has been found, a network admin can execute commands on the remote machine.

Configuring SSH on a router in Packet Tracer

For this tutorial, we’ll configure SSH on the router so that you, the admin, can access and manage it remotely using an SSH client on the admin PC.
And now on to it:
First, build the network topology.
Then do this basic IP configuration on the PCs and the Router:

Router

Router>enable

Router#configure terminal

Router(config)#int fa0/0

Router(config-if)ip add 192.168.10.1 255.255.255.0

Router(config-if)#no sh

 
PCs 
   

Device

IP Address

Default gateway

Subnet mask

PC1

192.168.10.2

192.168.10.1

255.255.255.0

PC2

192.168.10.3

192.168.10.1

255.255.255.0

PC3

192.168.10.4

192.168.10.1

255.255.255.0


Now, to set up SSH on the router, you’ll need to:

1. Set Router’s hostname

Router(config)#hostname R1


2. Set domain name

R1(config)#ip domain-name rupp.com


Both the hostname and domain name will be used in the process of generating encryption keys.

3. Now generate encryption keys for securing the session using the command crypto key generate rsa.

R1(config)#crypto key generate rsa

The name for the keys will be: R1.rupp.com

Choose the size of the key modulus in the range of 360 to 2048 for your

General Purpose Keys. Choosing a key modulus greater than 512 may take

a few minutes.

How many bits in the modulus [512]: 1024

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

4. Set an enable password 

R1(config)# enable password admin
  
Note that this password is not for use with SSH; its only for use in accessing the privileged executive mode of the router after you are able to access its CLI remotely via SSH.

5. Set username and password for local login.

R1(config)#username rupp password rupp1


The password will have to be provided before you can access the CLI of the router when using SSH.

6. Specify the SSH version to use.

R1(config)#ip ssh version 2

7. Now connect to VTY lines of the Router and configure the SSH protocol.
R1(config)#line vty 0  4
R1(config-line)#transport input ssh
R1(config-line)#login local

That’s all for configuration. Move on to see if you can access the router remotely from the PC.

8. On the command prompt of the PC2, open an SSH session to the remote router by typing the command:  ssh -l rupp 192.168.10.1
rupp is the username set in step 5.

9.  Provide the login password which you set in step 5 and press enter. You’re now probably in the CLI of the router. Provide the enable password (the one you set in step 4) to access the privileged executive mode.



You can proceed and do configurations on the Router. You’re now managing the router remotely from the PC2.


Note:

v    The command Login Local and Login. My quick and easy way to remember it is: Login = You need 1    piece of ID to get in a password. Login Local = You need 2 pieces, both a username and a password. 

v    Line console 0 and line vty. console 0 is the physical console port on the switch/router you plug into.      line vty is when you remote into the switch/router via telnet or ssh.

 

 

Packet Tracer – OSPFv3 Configure

 Create topology for OSPF IPv6 Configure 
!R1
ipv6 unicast-routing
interface FastEthernet0/1
ipv6 enable
ipv6 address 2001:dbb:1:ba::2/64
no shutdown
exit
int fa0/0
ipv6 enable
ipv6 address 2001:dbb:1:ab::1/64
no shutdown
exit
ipv6 router ospf 10
router-id 1.1.1.1
exit
int f0/0
ipv6 ospf 10 area 0
exit
int f0/1
ipv6 ospf 10 area 0
do wr
!R2
ipv6 unicast-routing
interface FastEthernet0/0
ipv6 enable
ipv6 address 2001:dbb:1:ba::1/64
no shutdown
exit
int fa0/1
ipv6 enable
ipv6 address 2001:dbb:1:b1::1/64
no shutdown
exit
int eth1/0
ipv6 enable
ipv6 address 2001:dbb:1:b2::1/64
no shutdown
exit
ipv6 router ospf 10
router-id 2.2.2.2
exit
int f0/0
ipv6 ospf 10 area 0
exit
int f0/1
ipv6 ospf 10 area 1
exit
int eth1/0
ipv6 ospf 10 area 1
do wr
!R3
ipv6 unicast-routing
interface FastEthernet0/0
ipv6 enable
ipv6 address 2001:dbb:1:b1::2/64
no shutdown
exit
int fa0/1
ipv6 enable
ipv6 address 2001:dbb:1:b4::1/64
no shutdown
exit
int eth1/0
ipv6 enable
ipv6 address 2001:dbb:1:b3::1/64
no shutdown
exit
ipv6 router ospf 10
router-id 3.3.3.3
exit
int f0/0
ipv6 ospf 10 area 1
exit
int f0/1
ipv6 ospf 10 area 1
exit
int eth1/0
ipv6 ospf 10 area 1
do wr
!R4
ipv6 unicast-routing
interface FastEthernet0/0
ipv6 enable
ipv6 address 2001:dbb:1:b2::2/64
no shutdown
exit
int eth1/0
ipv6 enable
ipv6 address 2001:dbb:1:b3::2/64
no shutdown
exit
ipv6 router ospf 10
router-id 4.4.4.4
exit
int f0/0
ipv6 ospf 10 area 1
exit
int eth1/0
ipv6 ospf 10 area 1
do wr
!R5
ipv6 unicast-routing
interface FastEthernet0/1
ipv6 enable
ipv6 address 2001:dbb:1:ab::2/64
no shutdown
exit
int f0/0
ipv6 enable
ipv6 address 2001:dbb:1:a2::1/64
no shutdown
exit
int eth1/0
ipv6 enable
ipv6 address 2001:dbb:1:a1::1/64
no shutdown
ipv6 router ospf 10
router-id 5.5.5.5
exit
int f0/1
ipv6 ospf 10 area 0
exit
int eth1/0
ipv6 ospf 10 area 2
int f0/0
ipv6 ospf 10 area 2
do wr
!R6
ipv6 unicast-routing
interface FastEthernet0/1
ipv6 enable
ipv6 address 2001:dbb:1:a2::2/64
no shutdown
exit
int f0/0
ipv6 enable
ipv6 address 2001:dbb:1:a3::2/64
no shutdown
exit
int eth1/0
ipv6 enable
ipv6 address 2001:dbb:1:a4::1/64
no shutdown
ipv6 router ospf 10
router-id 6.6.6.6
exit
int f0/1
ipv6 ospf 10 area 2
exit
int eth1/0
ipv6 ospf 10 area 2
int f0/0
ipv6 ospf 10 area 2
do wr
!R7
ipv6 unicast-routing
interface FastEthernet0/0
ipv6 enable
ipv6 address 2001:dbb:1:a1::2/64
no shutdown
exit
int eth1/0
ipv6 enable
ipv6 address 2001:dbb:1:a3::1/64
no shutdown
ipv6 router ospf 10
router-id 7.7.7.7
exit
int f0/0
ipv6 ospf 10 area 2
exit
int eth1/0
ipv6 ospf 10 area 2
do wr


Tuesday, 21 March 2023

Packet Tracer – Configure Telnet, VLAN, and DHCP together in a topology


Here is how to configure Telnet, VLAN, and DHCP on a Switch in Cisco Packet Tracer. Create the network topology below in Packet Tracer.

 

1. Telnet configuration on a switch

Switch>enable 

Switch#configure terminal 

Switch(config)#hos S1

S1(config)#line console 0   

S1(config-line)#password 123

S1(config-line)#login

S1(config-line)#exit

S1(config)#enable password 123456

S1(config)#username chhanun password chhanun1

S1(config)#line vty 0 4

S1(config-line)#login local

S1(config-line)#transport input telnet

S1(config-line)#exit 

2. VLAN configuration on a switch

S1>enable 

S1#configure terminal

S1(config)#vlan 10

S1(config-vlan)#name TEED

S1(config-vlan)#vlan 20

S1(config-vlan)#name ITE

S1(config-vlan)#exit

S1(config)#interface vlan 10

S1(config-if)#ip address 192.168.10.2 255.255.255.0

S1(config-if)#int vlan 20

S1(config-if)#ip address 192.168.20.2 255.255.255.0

S1(config-if)#exit

S1(config)#int range fa0/1-2

S1(config-if-range)#switchport mode access 

S1(config-if-range)#switchport access vlan 10

S1(config-if-range)#int range fa0/3-4

S1(config-if-range)#switchport mode access 

S1(config-if-range)#switchport access vlan 20

S1(config-if-range)#exit

S1(config)#int fa0/5

S1(config-if-range)#switchport mode truck

S1(config-if-range)#exit 

Go to config sub-interface on Router 

Router>enable

Router#configure terminal

Router(config)#hos R1

R1(config)#interface f0/0

R1(config-if)#no sh

R1(config-if)exit 

R1(config)#int fa0/0.10

R1(config-subif)#encapsulation dot1Q 10

R1(config-subif)#ip address 192.168.10.1 255.255.255.0

R1(config-subif)#int fa0/0.20

R1(config-subif)#encapsulation dot1Q 20

R1(config-subif)#ip address 192.168.20.1 255.255.255.0

R1(config-subif)#end

R1#wr 

3. DHCP configuration on a switch

 S1>enable

S1#confi t

S1(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.10

S1(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10

S1(config)#ip dhcp pool VLAN10

S1(dhcp-config)#network 192.168.10.0 255.255.255.0

S1(dhcp-config)#default-router 192.168.10.1

S1(dhcp-config)#dns-server 8.8.8.8

S1(dhcp-config)#exit

S1(config)#ip dhcp pool VLAN20

S1(dhcp-config)#network 192.168.20.0 255.255.255.0

S1(dhcp-config)#default-router 192.168.20.1

S1(dhcp-config)#dns-server 8.8.8.8

S1(dhcp-config)#end

S1#wr

 


What is loopback address?

  A loopback address is a special IP address that is used to test the network interface card (NIC) and the TCP/IP protocol stack on a comput...