Professional Documents
Culture Documents
CODE:
#include <bits/stdc++.h>
#include <windows.h>
int main()
string s;
cout<<"OSI MODEL\n";
cout<<"RECIEVER SIDE\n";
Sleep(1000);
cout<<"Entering the application layer. \n";
cout<<"enter the message\n"; cin>>s;
Sleep(1000);
s="pt"+s;
s="sh"+s;
Sleep(1000);
s="th"+s;
Sleep(1000);
s="nh"+s;
Sleep(1000);
s="dh"+s;
Sleep(1000);
s="ph"+s;
s.replace(0,2,"0");//p
s.replace(1,2,"1");//da
s.replace(2,2,"0");//t s.replace(3,2,"1");
//session
s.replace(4,2,"0");//pre s.replace(5,2,"1");
// cout<<"length is:"<<l<<"\n";
int val=stoi(orig);
itoa(val,res,2);
Sleep(2000);
Sleep(2000);
cout<<"\n------------------------RECIEVER SIDE ";
cout<<"\nRecived message is"<<s;
Sleep(1000);
cout<<"\nafter Passing thorugh physical layer data
is:"<<setw(10)<<s.substr(1,s.length()-1);
Sleep(1000);
cout<<"\nafter Passing thorugh Datalink layer data
is:"<<setw(10)<<s.substr(2,s.length()-1);
Sleep(1000);