# Neighbor Session Solutions for Integrated Routing Protocols
## 4 Modeling Protocol Integration Solution Classes
### PISC 3--L3 Transport, Multiple Adjacencies
#### 4.1.1 Sending Part
Based on the data in the packet, the neighbor's IPv6 address in the neighbor table6 is modified, as in the case of IPv4. A routing message is extracted from the packet and stored in Received6. The resulting routing message is processed by the Process RoutePacket6 transition, the same as in the IPv4 part of the model. By creating a separate part of the IPv6 handling model described in this subsection, it is possible to represent the establishment of two separate neighbor sessions, one for the IPv4 protocol and the other for the IPv6 protocol. #### 4.1.5 Representation of Router B

A graphical representation of the common and IPv4 parts of Router B is shown in Figure 8.

As we can notice in Figure 8, router B is a copy of the model part of router A, with changed names of places and transitions (the letter B added at the end). Also, the L2 and L3 addresses in packets and frames and neighbor tables have been changed, as router B has an address set to 2. The IPv6 part is modified equivalently and visible in the full graphical representation of neighbor B shown in Figure S3. ### Pisc4 Transport L3, One Neighborship

We derive the model of the fourth PISC from the full model of the third class. The entire graphical representation of the created model representing the fourth class is shown in Figure S4, and the source file of the model for CPN Tools is available in Source S4. In the first step, we remove the IPv6-specific parts from the model since the fourth-class model creates only one common neighborship. Subsequently, we deal with the modification of the sending part. #### 4.2.1 Sending Part

The sending part again consists of places (to send, neighbor table, Added L3, and Added L2) and transitions (Encapsulate L3 and Encapsulate L2), but they have been modified as shown in Figure 3:0

Figure 3:1 PISC 3—Router B common and IPv4 part. The first problem is the fact that in the class four model, we create only one adjacency, and the message transfer takes place at the network layer, so routing messages can be encapsulated in both an IPv4 and an IPv6 packet. But the routers must communicate using the same version of the IP protocol since they are not \"compatible\" with each other. As the most general solution, after various attempts, we come up with the following algorithm. The first routing message is sent twice, wrapped in an IPv4 packet and the other in an IPv6 packet, and sent over the network (assuming the router has both network protocol support enabled). The other router, based on which packet it receives first, will only communicate with that neighbor using the network protocol that receives the packet first. The second router proceeds equivalently. An optimization of this algorithm can be to send the first of the two IPv6 packets to minimize situations where each router sends a different network protocol packet first. With this algorithm, we ensure that routers can communicate with each other using a common network protocol, and nothing prevents the establishment of adjacency and the subsequent exchange of routing information (both supported network protocols). The following changes in the sending part are necessary to model the proposed algorithm. First, we add an entry to the neighbor table indicating the neighborhood with which we establish the network protocol (value 4 for IPv4 and 6 for IPv6 protocol). The resulting modified definition of the neighbor table entry is as follows:
```
colsetNEIGHBOR=recordid:INT*l2 add:INT*l3 add:INT*seq:INT*ack:INT*neighbord:BOOL*route:BOOL*typ:INT;
```

We then modify the edge function from the Encapsulate L2 transition to the Added L2 place as shown in Figure 3:2

If the neighbor type is set to four in the neighbor table (we received the first packet with IPv4 protocol), the function will pack only IPv4 packets into frames. However, if the type is set to six, only IPv6 packets will enter the frames. If the type is set to a value

Figure 3:3 P15C4—Encapsulate L2 transition function. Figure 3:4 P15C4—Encapsulate L2 transition function.