PROGRAM 01:
BIT STUFFING
AIM:
To write a program to implement the data link layer framing methods such as bit stuffing.
SOURCE CODE:
#include<stdio.h>
#include<string.h>
int main()
{
int a[20],b[30], i, j, k, count, n;
printf("Enter frame size (Example: 8):");
scanf("%d", &n);
printf("Enter the frame in the form of 0 and 1 :");
for(i=0; i<n; i++)
scanf("%d", &a[i]);
i=0;
count=1;
j=0;
while(i<n)
{
if(a[i]==1)
{
b[j]=a[i];
for(k=i+1; a[k]==1 && k<n && count<5; k++)
{
j++;
b[j]=a[k];
count++;
if(count==5)
{
j++;
b[j]=0;
}
i=k;
}
}
else
{
b[j]=a[i];
}
i++;
j++;
}
printf("After Bit Stuffing :");
for(i=0; i<j; i++)
printf("%d", b[i]);
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the data link layer framing methods such as bit stuffing was successfully
written and executed.
PROGRAM 02:
CHARACTER STUFFING
AIM:
To write a program to implement the data link layer framing methods such as character stuffing.
SOURCE CODE:
#include <stdio.h>
#include <conio.h>
#include <string.h>
#define FLAG_BYTE 'P'
#define ESCAPE_BYTE 'R'
int main()
{
char data_frame[100];
char stuffed_frame[200];
int i, j = 0;
printf("Enter the data frame (characters): ");
scanf("%s", data_frame);
// Add starting FLAG
stuffed_frame[j++] = FLAG_BYTE;
for (i = 0; i < strlen(data_frame); i++)
{
if (data_frame[i] == FLAG_BYTE || data_frame[i] == ESCAPE_BYTE)
{
// Insert ESCAPE before FLAG or ESCAPE
stuffed_frame[j++] = ESCAPE_BYTE;
}
stuffed_frame[j++] = data_frame[i];
}
// Add ending FLAG
stuffed_frame[j++] = FLAG_BYTE;
stuffed_frame[j] = '\0'; // Null terminate the string
printf("Original Data Frame : %s\n", data_frame);
printf("Stuffed Data Frame : %s\n", stuffed_frame);
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the data link layer framing methods such as character stuffing was
successfully written and executed.
PROGRAM 03:
CHARACTER COUNT
AIM:
To write a program to implement the data link layer framing methods such as character count.
SOURCE CODE:
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
int i, n;
char frames[100][100];
printf("Enter the number of frames: ");
scanf("%d", &n);
getchar();
for(i=0; i<n; i++)
{
printf("Enter data for frame %d: ", i+1);
fgets(frames[i], sizeof (frames[i]), stdin);
if(frames[i][strlen(frames[i])-1] == '\n')
{
frames[i][strlen(frames[i])-1] = '\0';
}
}
printf("\n Framed Output : ");
for(i=0; i<n; i++)
{
int len = strlen(frames[i]);
printf("[%d]%s", len, frames[i]);
}
printf("\n");
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the data link layer framing methods such as character count was
successfully written and executed.
PROGRAM 04:
CHECKSUM
AIM:
To write a program to implement the error detection methods such as checksum.
SOURCE CODE:
#include <stdio.h>
#include <string.h>
#define MAX_FRAMES 50
#define MAX_LEN 128
/* add src to dst of length len, store result in dst.
returns carry-out (0 or 1) */
int add_no_wrap(char dst[], const char src[], int len)
{
int carry = 0;
int i;
for (i = len - 1; i >= 0; --i) {
int a = dst[i] - '0';
int b = src[i] - '0';
int s = a + b + carry;
dst[i] = (char)((s % 2) + '0');
carry = s / 2;
}
return carry;
}
/* add 1 to dst (LSB) and return carry-out (0 or 1) */
int add_one(char dst[], int len)
{
int carry = 1;
int i;
for (i = len - 1; i >= 0; --i) {
int a = dst[i] - '0';
int s = a + carry;
dst[i] = (char)((s % 2) + '0');
carry = s / 2;
if (carry == 0) break; /* no more carry */
}
return carry;
}
/* perform addition with end-around carry: add frame into sum[] */
void add_with_endaround(char sum[], const char frame[], int len)
{
int carry;
carry = add_no_wrap(sum, frame, len);
while (carry) {
/* add the carry back to LSB (end-around) */
carry = add_one(sum, len);
}
}
/* 1's complement in place */
void ones_complement(char s[], int len)
{
int i;
for (i = 0; i < len; ++i) {
if (s[i] == '0') s[i] = '1';
else s[i] = '0';
}
}
/* print len bits from s (no newline) */
void printBits(const char s[], int len)
{
int i;
for (i = 0; i < len; ++i) putchar(s[i]);
}
int main(void)
{
int n, len;
char frames[MAX_FRAMES][MAX_LEN + 1];
char sum[MAX_LEN + 1];
char checksum[MAX_LEN + 1];
char rsum[MAX_LEN + 1];
int i;
printf("Enter number of frames (1..%d): ", MAX_FRAMES);
if (scanf("%d", &n) != 1) {
printf("Invalid input.\n");
return 1;
}
if (n <= 0 || n > MAX_FRAMES) {
printf("Number of frames out of range.\n");
return 1;
}
printf("Enter bit-length of each frame (1..%d): ", MAX_LEN);
if (scanf("%d", &len) != 1) {
printf("Invalid input.\n");
return 1;
}
if (len <= 0 || len > MAX_LEN) {
printf("Frame length out of range.\n");
return 1;
}
for (i = 0; i < n; ++i) {
printf("Enter frame %d (%d bits, only 0/1): ", i + 1, len);
if (scanf("%s", frames[i]) != 1) {
printf("Input error.\n");
return 1;
}
if ((int)strlen(frames[i]) != len) {
printf("Frame %d length mismatch: expected %d bits, got %zu bits.\n", i + 1, len,
strlen(frames[i]));
return 1;
}
/* validate characters */
{
int j;
for (j = 0; j < len; ++j) {
if (frames[i][j] != '0' && frames[i][j] != '1') {
printf("Frame %d contains invalid character. Use only '0' and '1'.\n", i + 1);
return 1;
}
}
}
}
/* Sender side: initialize sum with first frame */
for (i = 0; i < len; ++i) sum[i] = frames[0][i];
sum[len] = '\0';
printf("\n--- Sender addition steps ---\n");
printf("Initial sum = ");
printBits(sum, len);
printf("\n");
for (i = 1; i < n; ++i) {
printf("\nAdding frame %d : ", i + 1);
printBits(frames[i], len);
printf("\nBefore add : ");
printBits(sum, len);
printf("\n");
add_with_endaround(sum, frames[i], len);
printf("After add : ");
printBits(sum, len);
printf("\n");
}
/* checksum = 1's complement of sum */
{
int k;
for (k = 0; k < len; ++k) checksum[k] = sum[k];
checksum[len] = '\0';
}
ones_complement(checksum, len);
printf("\nSender final sum : ");
printBits(sum, len);
printf("\nChecksum (1's comp): ");
printBits(checksum, len);
printf("\n");
/* Receiver side: add frames then checksum */
{
int k;
for (k = 0; k < len; ++k) rsum[k] = frames[0][k];
rsum[len] = '\0';
}
printf("\n--- Receiver addition steps ---\n");
printf("Initial rsum = ");
printBits(rsum, len);
printf("\n");
for (i = 1; i < n; ++i) {
printf("\nAdding frame %d : ", i + 1);
printBits(frames[i], len);
printf("\nBefore add : ");
printBits(rsum, len);
printf("\n");
add_with_endaround(rsum, frames[i], len);
printf("After add : ");
printBits(rsum, len);
printf("\n");
}
printf("\nAdding checksum : ");
printBits(checksum, len);
printf("\nBefore add : ");
printBits(rsum, len);
printf("\n");
add_with_endaround(rsum, checksum, len);
printf("After add : ");
printBits(rsum, len);
printf("\n");
/* check final result: should be all '1's if no error */
{
int ok = 1;
int t;
for (t = 0; t < len; ++t) {
if (rsum[t] != '1') { ok = 0; break; }
}
if (ok) printf("\nResult: No error detected (final sum is all 1's).\n");
else {
printf("\nResult: Error detected (final sum is not all 1's).\n");
printf("Receiver final sum: ");
printBits(rsum, len);
printf("\n");
}
}
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the error detection methods such as checksum was successfully written
and executed.
PROGRAM 05:
CYCLIC REDUNDANCY CHECK
AIM:
To write a program to implement the error detection methods such as cyclic redundancy check (CRC).
SOURCE CODE:
#include<stdio.h>
#include<string.h>
#define N strlen(gen_poly)
char data[28];
char check_value[28];
char gen_poly[10];
int data_length,i,j;
void XOR()
{
for(j = 1;j < N; j++)
check_value[j] = (( check_value[j] == gen_poly[j])?'0':'1');
void receiver()
{
printf("Enter the received data: ");
scanf("%s", data);
printf("\n-----------------------------\n");
printf("Data received: %s", data);
crc();
for(i=0;(i<N-1) && (check_value[i]!='1');i++);
if(i<N-1)
printf("\nError detected\n\n");
else
printf("\nNo error detected\n\n");
}
void crc()
{
for(i=0;i<N;i++)
check_value[i]=data[i];
do
{
if(check_value[0]=='1')
XOR();
for(j=0;j<N-1;j++)
check_value[j]=check_value[j+1];
check_value[j]=data[i++];
}
while(i<=data_length+N-1);
}
int main()
{
printf("\nEnter data to be transmitted: ");
scanf("%s",data);
printf("\nEnter the Generating polynomial: ");
scanf("%s",gen_poly);
data_length=strlen(data);
for(i=data_length;i<data_length+N-1;i++)
data[i]='0';
printf("\n----------------------------------------");
printf("\n Data padded with n-1 zeros : %s",data);
printf("\n----------------------------------------");
crc();
printf("\nCRC or Check value is : %s",check_value);
for(i=data_length;i<data_length+N-1;i++)
data[i]=check_value[i-data_length];
printf("\n----------------------------------------");
printf("\n Final data to be sent : %s",data);
printf("\n----------------------------------------\n");
receiver();
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the error detection methods such as cyclic redundancy check (CRC) was
successfully written and executed.
PROGRAM 06:
PARITY GENERATOR
AIM:
To write a program to implement the error detection methods such as parity generator.
SOURCE CODE:
#include <stdio.h>
#include <string.h>
#define MAX_LEN 256
int count_ones(const char data[])
{
int i, count = 0;
for (i = 0; data[i] != '\0'; ++i)
{
if (data[i] == '1') ++count;
}
return count;
}
int main(void)
{
char data[MAX_LEN];
int parity_type;
int ones, parity_bit;
char framed[MAX_LEN + 2];
printf("Enter binary data (e.g. 1010101): ");
if (scanf("%255s", data) != 1)
{
printf("Input error.\n");
return 1;
}
{
int i, ok = 1;
for (i = 0; data[i] != '\0'; ++i) {
if (data[i] != '0' && data[i] != '1') { ok = 0; break; }
}
if (!ok) {
printf("Invalid input: only '0' and '1' allowed.\n");
return 1;
}
}
printf("Enter parity type (0 for EVEN, 1 for ODD): ");
if (scanf("%d", &parity_type) != 1 || (parity_type != 0 && parity_type != 1))
{
printf("Invalid parity type. Enter 0 (Even) or 1 (Odd).\n");
return 1;
}
ones = count_ones(data);
if (parity_type == 0)
{
parity_bit = (ones % 2 == 0) ? 0 : 1;
}
else
{
parity_bit = (ones % 2 == 0) ? 1 : 0;
}
strncpy(framed, data, MAX_LEN);
framed[MAX_LEN] = '\0';
strncat(framed, (parity_bit ? "1" : "0"), 1);
printf("\nNumber of 1's in data : %d\n", ones);
printf("Parity type : %s\n", (parity_type == 0) ? "Even" : "Odd");
printf("Calculated parity bit : %d\n", parity_bit);
printf("Data with parity bit : %s\n", framed);
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the error detection methods such as parity generator was successfully
written and executed.
PROGRAM 07:
SLIDING WINDOW PROTOCOL
AIM:
To write a program to implement the sliding window protocols.
SOURCE CODE:
#include<stdio.h>
int main()
{
int w,i,f,frames[50];
printf("Enter window size: ");
scanf("%d",&w);
printf("\nEnter number of frames to transmit: ");
scanf("%d",&f);
printf("\nEnter %d frames: ",f);
for(i=1;i<=f;i++)
scanf("%d",&frames[i]);
printf("\nWith sliding window protocol the frames will be sent in the following manner (assuming no
corruption of frames)\n\n");
printf("After sending %d frames at each stage sender waits for acknowledgement sent by the
receiver\n\n",w);
for(i=1;i<=f;i++)
{
if(i%w==0)
{
printf("%d\n",frames[i]);
printf("Acknowledgement of above frames sent is received by sender\n\n");
}
else
printf("%d ",frames[i]);
}
if(f%w!=0)
printf("\nAcknowledgement of above frames sent is received by sender\n");
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the sliding window protocols was successfully written and executed.
PROGRAM 08:
RSA (Rivest-Shamir-Adleman) ALGORITHM
AIM:
To write a program to implement RSA (Rivest-Shamir-Adleman) algorithm.
SOURCE CODE:
#include <stdio.h>
#include <stdlib.h>
/* Function to check if number is prime */
int checkPrime(int n) {
int i;
if (n <= 1) return 0;
for (i = 2; i <= n / 2; i++) {
if (n % i == 0)
return 0;
}
return 1;
}
/* Function to compute GCD */
int findGCD(int n1, int n2) {
int i, gcd = 1;
for (i = 1; i <= n1 && i <= n2; i++) {
if (n1 % i == 0 && n2 % i == 0)
gcd = i;
}
return gcd;
}
/* Fast Modular Exponentiation */
long long powMod(long long a, long long b, long long n) {
long long result = 1;
long long base = a % n;
while (b > 0) {
if (b % 2 == 1) // If b is odd
result = (result * base) % n;
base = (base * base) % n;
b /= 2;
}
return result;
}
int main() {
int p, q, n, phin;
int data, cipher, decrypt;
int e, d;
/* Step 1: Input primes */
while (1) {
printf("Enter two prime numbers (p and q): ");
scanf("%d %d", &p, &q);
if (!checkPrime(p) || !checkPrime(q)) {
printf("Both numbers must be prime. Try again.\n");
} else {
break;
}
}
/* Step 2: Compute n and f(n) */
n = p * q;
phin = (p - 1) * (q - 1);
/* Step 3: Choose e such that gcd(e, f(n)) = 1 */
for (e = 2; e < phin; e++) {
if (findGCD(e, phin) == 1)
break;
}
/* Step 4: Find d such that (d * e) % f(n) = 1 */
for (d = 2; d < phin; d++) {
if ((d * e) % phin == 1)
break;
}
printf("\nPublic Key (e, n): (%d, %d)", e, n);
printf("\nPrivate Key (d, n): (%d, %d)\n", d, n);
/* Step 5: Encrypt */
printf("\nEnter a number to encrypt (less than %d): ", n);
scanf("%d", &data);
cipher = (int)powMod(data, e, n);
printf("Encrypted cipher: %d\n", cipher);
/* Step 6: Decrypt */
decrypt = (int)powMod(cipher, d, n);
printf("Decrypted message: %d\n", decrypt);
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement RSA (Rivest-Shamir-Adleman) algorithm was successfully written and
executed.
PROGRAM 09:
DES (Data Encryption Standard) CODING
AIM:
To write a program to implement DES (Data Encryption Standard) coding.
SOURCE CODE:
#include <stdio.h>
// Simplified initial and final permutation tables
int initial_perm[64] = {
58,50,42,34,26,18,10,2,
60,52,44,36,28,20,12,4,
62,54,46,38,30,22,14,6,
64,56,48,40,32,24,16,8,
57,49,41,33,25,17,9,1,
59,51,43,35,27,19,11,3,
61,53,45,37,29,21,13,5,
63,55,47,39,31,23,15,7
};
int final_perm[64] = {
40,8,48,16,56,24,64,32,
39,7,47,15,55,23,63,31,
38,6,46,14,54,22,62,30,
37,5,45,13,53,21,61,29,
36,4,44,12,52,20,60,28,
35,3,43,11,51,19,59,27,
34,2,42,10,50,18,58,26,
33,1,41,9,49,17,57,25
};
// Function to perform permutation
unsigned long long permute(unsigned long long input, int *perm_table) {
unsigned long long output = 0;
int i;
for(i = 0; i < 64; i++) {
output <<= 1;
output |= (input >> (64 - perm_table[i])) & 1ULL;
}
return output;
}
int main() {
unsigned long long plaintext = 0, key = 0;
printf("Enter 64-bit plaintext (hex, e.g., 0123456789ABCDEF): ");
if(scanf("%I64X", &plaintext) != 1)
{
printf("Invalid input!\n");
return 1;
}
printf("Enter 64-bit key (hex, e.g., 133457799BBCDFF1): ");
if(scanf("%I64X", &key) != 1) {
printf("Invalid input!\n");
return 1;
}
printf("\nOriginal plaintext: %016I64X\n", plaintext);
// Initial permutation
unsigned long long ip = permute(plaintext, initial_perm);
printf("After initial permutation: %016I64X\n", ip);
// Simplified encryption: XOR with key (placeholder for DES rounds)
unsigned long long xor_output = ip ^ key;
// Final permutation
unsigned long long ciphertext = permute(xor_output, final_perm);
printf("Ciphertext: %016I64X\n", ciphertext);
// Decryption (reverse process)
unsigned long long fp = permute(ciphertext, initial_perm); // IP for decryption
unsigned long long decrypted = permute(fp ^ key, final_perm);
printf("Decrypted text: %016I64X\n", decrypted);
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement DES (Data Encryption Standard) coding was successfully written and
executed.
PROGRAM 1 0 :
SHORTEST PATH (DIJKSTRA’S) ROUTING ALGORITHM
AIM:
To write a program to implement the Shortest Path (Dijkstra’s) Routing Algorithm.
SOURCE CODE:
#include<stdio.h>
#include<conio.h>
#define INFINITY 9999
#define MAX 10
void dijkstra(int G[MAX][MAX],int n,int startnode);
int main()
{
int G[MAX][MAX],i,j,n,u;
printf("Enter no. of vertices:");
scanf("%d",&n);
printf("\nEnter the adjacency matrix:\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&G[i][j]);
printf("\nEnter the starting node:");
scanf("%d",&u);
dijkstra(G,n,u);
return 0;
}
void dijkstra(int G[MAX][MAX],int n,int startnode)
{
int cost[MAX][MAX],distance[MAX],pred[MAX];
int visited[MAX],count,mindistance,nextnode,i,j;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
if(G[i][j]==0)
cost[i][j]=INFINITY;
else
cost[i][j]=G[i][j];
for(i=0;i<n;i++)
{
distance[i]=cost[startnode][i];
pred[i]=startnode;
visited[i]=0;
}
distance[startnode]=0;
visited[startnode]=1;
count=1;
while(count<n-1)
{
mindistance=INFINITY;
for(i=0;i<n;i++)
if(distance[i]<mindistance&&!visited[i])
{
mindistance=distance[i];
nextnode=i;
}
visited[nextnode]=1;
for(i=0;i<n;i++)
if(!visited[i])
if(mindistance+cost[nextnode][i]<distance[i])
{
distance[i]=mindistance+cost[nextnode][i];
pred[i]=nextnode;
}
count++;
}
for(i=0;i<n;i++)
if(i!=startnode)
{
printf("\nDistance of node%d=%d",i,distance[i]);
printf("\nPath=%d",i);
j=i;
do
{
j=pred[j];
printf("<-%d",j);
}while(j!=startnode);
}
}
OUTPUT:
RESULT:
Hence, a program to implement the Shortest Path (Dijkstra’s) Routing Algorithm was successfully written
and executed.
PROGRAM 1 1 :
BROADCAST ROUTING ALGORITHM
AIM:
To write a program to implement the Broadcast Routing Algorithm.
SOURCE CODE:
#include <stdio.h>
#define MAX_NODES 100
int adjacencyMatrix[MAX_NODES + 1][MAX_NODES + 1];
int visited[MAX_NODES + 1];
int numNodes;
void broadcast(int source)
{
int queue[MAX_NODES + 1];
int front = 0, rear = 0;
int curr, i;
visited[source] = 1;
queue[rear++] = source;
printf("\nBroadcast routing (each node receives packet exactly once):\n");
while (front < rear)
{
curr = queue[front++];
printf("Node %d received the packet\n", curr);
for (i = 1; i <= numNodes; i++)
{
if (adjacencyMatrix[curr][i] == 1 && !visited[i])
{
visited[i] = 1;
queue[rear++] = i;
}
}
}
}
int main(void)
{
int i, j;
int source, tmp;
for (i = 0; i <= MAX_NODES; i++)
{
visited[i] = 0;
for (j = 0; j <= MAX_NODES; j++)
adjacencyMatrix[i][j] = 0;
}
printf("Enter number of nodes (1-%d): ", MAX_NODES);
if (scanf("%d", &numNodes) != 1 || numNodes < 1 || numNodes > MAX_NODES)
{
printf("Invalid number of nodes.\n");
return 1;
}
printf("Enter adjacency matrix (rows of 0/1 values):\n");
for (i = 1; i <= numNodes; i++)
{
for (j = 1; j <= numNodes; j++)
{
if (scanf("%d", &tmp) != 1 || (tmp != 0 && tmp != 1))
{
printf("Invalid input. Use 0 or 1.\n");
return 1;
}
adjacencyMatrix[i][j] = tmp;
}
}
printf("Enter source node (1 to %d): ", numNodes);
if (scanf("%d", &source) != 1 || source < 1 || source > numNodes)
{
printf("Invalid source node.\n");
return 1;
}
for (i = 1; i <= numNodes; i++) visited[i] = 0;
broadcast(source);
return 0;
}
OUTPUT:
RESULT:
Hence, a program to implement the Broadcast Routing Algorithm was successfully written and executed.
PROGRAM 12:
IP ADDRESS AND PORT NUMBER
AIM:
To write a program that determines and displays the IP address and port number.
SOURCE CODE:
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
#else
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
int main()
{
#ifdef _WIN32
WSADATA wsa;
if (WSAStartup(MAKEWORD(2,2), &wsa) != 0)
{
printf("Failed to initialize Winsock.\n");
return 1;
}
#endif
int sock;
struct sockaddr_in serverAddr, localAddr;
#ifdef _WIN32
int addrLen = sizeof(localAddr);
#else
socklen_t addrLen = sizeof(localAddr);
#endif
sock = socket(AF_INET, SOCK_DGRAM, 0); // UDP socket
if (sock < 0)
{
perror("Socket creation failed");
return 1;
}
// connect to a public IP, port 53 (DNS) to get local IP
memset(&serverAddr, 0, sizeof(serverAddr));
serverAddr.sin_family = AF_INET;
serverAddr.sin_port = htons(53); // arbitrary port
serverAddr.sin_addr.s_addr = inet_addr("[Link]"); // Google DNS
if (connect(sock, (struct sockaddr*)&serverAddr, sizeof(serverAddr)) < 0)
{
perror("Connect failed");
return 1;
}
if (getsockname(sock, (struct sockaddr*)&localAddr, &addrLen) < 0)
{
perror("getsockname failed");
return 1;
}
printf("Local IP Address: %s\n", inet_ntoa(localAddr.sin_addr));
printf("Local Port: %d\n", ntohs(localAddr.sin_port));
#ifdef _WIN32
closesocket(sock);
WSACleanup();
#else
close(sock);
#endif
return 0;
}
OUTPUT:
Local IP Address: [Link]
Local Port: 54321
RESULT:
Hence, a program that determines and displays the IP address and port number was successfully written
and executed.