|
68 |
m_endPoint (0), |
68 |
m_endPoint (0), |
69 |
m_node (0), |
69 |
m_node (0), |
70 |
m_tcp (0), |
70 |
m_tcp (0), |
71 |
m_localAddress (Ipv4Address::GetZero ()), |
|
|
72 |
m_localPort (0), |
73 |
m_errno (ERROR_NOTERROR), |
71 |
m_errno (ERROR_NOTERROR), |
74 |
m_shutdownSend (false), |
72 |
m_shutdownSend (false), |
75 |
m_shutdownRecv (false), |
73 |
m_shutdownRecv (false), |
|
107 |
m_endPoint (0), |
105 |
m_endPoint (0), |
108 |
m_node (sock.m_node), |
106 |
m_node (sock.m_node), |
109 |
m_tcp (sock.m_tcp), |
107 |
m_tcp (sock.m_tcp), |
110 |
m_remoteAddress (sock.m_remoteAddress), |
|
|
111 |
m_remotePort (sock.m_remotePort), |
112 |
m_localAddress (sock.m_localAddress), |
113 |
m_localPort (sock.m_localPort), |
114 |
m_errno (sock.m_errno), |
108 |
m_errno (sock.m_errno), |
115 |
m_shutdownSend (sock.m_shutdownSend), |
109 |
m_shutdownSend (sock.m_shutdownSend), |
116 |
m_shutdownRecv (sock.m_shutdownRecv), |
110 |
m_shutdownRecv (sock.m_shutdownRecv), |
|
264 |
} |
258 |
} |
265 |
m_endPoint->SetRxCallback (MakeCallback (&TcpSocketImpl::ForwardUp, Ptr<TcpSocketImpl>(this))); |
259 |
m_endPoint->SetRxCallback (MakeCallback (&TcpSocketImpl::ForwardUp, Ptr<TcpSocketImpl>(this))); |
266 |
m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketImpl::Destroy, Ptr<TcpSocketImpl>(this))); |
260 |
m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketImpl::Destroy, Ptr<TcpSocketImpl>(this))); |
267 |
m_localAddress = m_endPoint->GetLocalAddress (); |
|
|
268 |
m_localPort = m_endPoint->GetLocalPort (); |
269 |
return 0; |
261 |
return 0; |
270 |
} |
262 |
} |
271 |
|
263 |
|
|
375 |
NS_ASSERT (m_endPoint != 0); |
367 |
NS_ASSERT (m_endPoint != 0); |
376 |
} |
368 |
} |
377 |
InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); |
369 |
InetSocketAddress transport = InetSocketAddress::ConvertFrom (address); |
378 |
m_remoteAddress = transport.GetIpv4 (); |
370 |
m_endPoint->SetPeer(transport.GetIpv4 (), transport.GetPort ()); |
379 |
m_remotePort = transport.GetPort (); |
|
|
380 |
|
371 |
|
381 |
if (ipv4->GetRoutingProtocol () != 0) |
372 |
if (ipv4->GetRoutingProtocol () != 0) |
382 |
{ |
373 |
{ |
383 |
Ipv4Header header; |
374 |
Ipv4Header header; |
384 |
header.SetDestination (m_remoteAddress); |
375 |
header.SetDestination (m_endPoint->GetPeerAddress()); |
385 |
Socket::SocketErrno errno_; |
376 |
Socket::SocketErrno errno_; |
386 |
Ptr<Ipv4Route> route; |
377 |
Ptr<Ipv4Route> route; |
387 |
uint32_t oif = 0; //specify non-zero if bound to a source address |
378 |
uint32_t oif = 0; //specify non-zero if bound to a source address |
|
394 |
} |
385 |
} |
395 |
else |
386 |
else |
396 |
{ |
387 |
{ |
397 |
NS_LOG_LOGIC ("TcpSocketImpl::Connect(): Route to " << m_remoteAddress << " does not exist"); |
388 |
NS_LOG_LOGIC ("TcpSocketImpl::Connect(): Route to " << m_endPoint->GetPeerAddress() << " does not exist"); |
398 |
NS_LOG_ERROR (errno_); |
389 |
NS_LOG_ERROR (errno_); |
399 |
m_errno = errno_; |
390 |
m_errno = errno_; |
400 |
return -1; |
391 |
return -1; |
|
600 |
} |
591 |
} |
601 |
} |
592 |
} |
602 |
SocketAddressTag tag; |
593 |
SocketAddressTag tag; |
603 |
tag.SetAddress (InetSocketAddress (m_remoteAddress, m_remotePort)); |
594 |
tag.SetAddress (InetSocketAddress (m_endPoint->GetPeerAddress(), m_endPoint->GetPeerPort())); |
604 |
outPacket->AddPacketTag (tag); |
595 |
outPacket->AddPacketTag (tag); |
605 |
return outPacket; |
596 |
return outPacket; |
606 |
} |
597 |
} |
|
636 |
TcpSocketImpl::GetSockName (Address &address) const |
627 |
TcpSocketImpl::GetSockName (Address &address) const |
637 |
{ |
628 |
{ |
638 |
NS_LOG_FUNCTION_NOARGS (); |
629 |
NS_LOG_FUNCTION_NOARGS (); |
639 |
address = InetSocketAddress(m_localAddress, m_localPort); |
630 |
address = InetSocketAddress(m_endPoint->GetLocalAddress(), m_endPoint->GetLocalPort()); |
640 |
return 0; |
631 |
return 0; |
641 |
} |
632 |
} |
642 |
|
633 |
|
643 |
void |
634 |
void |
644 |
TcpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Address ipv4, uint16_t port) |
635 |
TcpSocketImpl::ForwardUp (Ptr<Packet> packet, Ipv4Address saddr, Ipv4Address daddr, uint16_t port) |
645 |
{ |
636 |
{ |
646 |
NS_LOG_DEBUG("Socket " << this << " got forward up" << |
637 |
NS_LOG_DEBUG("Socket " << this << " got forward up" << |
647 |
" dport " << m_endPoint->GetLocalPort() << |
638 |
" dport " << m_endPoint->GetLocalPort() << |
|
649 |
" sport " << m_endPoint->GetPeerPort() << |
640 |
" sport " << m_endPoint->GetPeerPort() << |
650 |
" saddr " << m_endPoint->GetPeerAddress()); |
641 |
" saddr " << m_endPoint->GetPeerAddress()); |
651 |
|
642 |
|
652 |
NS_LOG_FUNCTION (this << packet << ipv4 << port); |
643 |
NS_LOG_FUNCTION (this << packet << saddr << daddr << port); |
|
|
644 |
|
645 |
Address fromAddress = InetSocketAddress (saddr, port); |
646 |
Address toAddress = InetSocketAddress (daddr, m_endPoint->GetLocalPort()); |
647 |
|
653 |
if (m_shutdownRecv) |
648 |
if (m_shutdownRecv) |
654 |
{ |
649 |
{ |
655 |
return; |
650 |
return; |
|
675 |
|
670 |
|
676 |
Events_t event = SimulationSingleton<TcpStateMachine>::Get ()->FlagsEvent (tcpHeader.GetFlags () ); |
671 |
Events_t event = SimulationSingleton<TcpStateMachine>::Get ()->FlagsEvent (tcpHeader.GetFlags () ); |
677 |
Actions_t action = ProcessEvent (event); //updates the state |
672 |
Actions_t action = ProcessEvent (event); //updates the state |
678 |
Address address = InetSocketAddress (ipv4, port); |
|
|
679 |
NS_LOG_DEBUG("Socket " << this << |
673 |
NS_LOG_DEBUG("Socket " << this << |
680 |
" processing pkt action, " << action << |
674 |
" processing pkt action, " << action << |
681 |
" current state " << m_state); |
675 |
" current state " << m_state); |
682 |
ProcessPacketAction (action, packet, tcpHeader, address); |
676 |
ProcessPacketAction (action, packet, tcpHeader, fromAddress, toAddress); |
683 |
} |
677 |
} |
684 |
|
678 |
|
685 |
Actions_t TcpSocketImpl::ProcessEvent (Events_t e) |
679 |
Actions_t TcpSocketImpl::ProcessEvent (Events_t e) |
|
708 |
{ |
702 |
{ |
709 |
Simulator::ScheduleNow(&TcpSocketImpl::ConnectionSucceeded, this); |
703 |
Simulator::ScheduleNow(&TcpSocketImpl::ConnectionSucceeded, this); |
710 |
m_connected = true; |
704 |
m_connected = true; |
711 |
m_endPoint->SetPeer (m_remoteAddress, m_remotePort); |
|
|
712 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " Connected!"); |
705 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " Connected!"); |
713 |
} |
706 |
} |
714 |
if (saveState < CLOSING && (m_state == CLOSING || m_state == TIMED_WAIT) ) |
707 |
if (saveState < CLOSING && (m_state == CLOSING || m_state == TIMED_WAIT) ) |
|
768 |
header.SetSequenceNumber (m_nextTxSequence); |
761 |
header.SetSequenceNumber (m_nextTxSequence); |
769 |
header.SetAckNumber (m_nextRxSequence); |
762 |
header.SetAckNumber (m_nextRxSequence); |
770 |
header.SetSourcePort (m_endPoint->GetLocalPort ()); |
763 |
header.SetSourcePort (m_endPoint->GetLocalPort ()); |
771 |
header.SetDestinationPort (m_remotePort); |
764 |
header.SetDestinationPort (m_endPoint->GetPeerPort()); |
772 |
header.SetWindowSize (AdvertisedWindowSize()); |
765 |
header.SetWindowSize (AdvertisedWindowSize()); |
773 |
m_tcp->SendPacket (p, header, m_endPoint->GetLocalAddress (), |
766 |
m_tcp->SendPacket (p, header, m_endPoint->GetLocalAddress (), |
774 |
m_remoteAddress); |
767 |
m_endPoint->GetPeerAddress()); |
775 |
Time rto = m_rtt->RetransmitTimeout (); |
768 |
Time rto = m_rtt->RetransmitTimeout (); |
776 |
bool hasSyn = flags & TcpHeader::SYN; |
769 |
bool hasSyn = flags & TcpHeader::SYN; |
777 |
bool hasFin = flags & TcpHeader::FIN; |
770 |
bool hasFin = flags & TcpHeader::FIN; |
|
882 |
|
875 |
|
883 |
bool TcpSocketImpl::ProcessPacketAction (Actions_t a, Ptr<Packet> p, |
876 |
bool TcpSocketImpl::ProcessPacketAction (Actions_t a, Ptr<Packet> p, |
884 |
const TcpHeader& tcpHeader, |
877 |
const TcpHeader& tcpHeader, |
885 |
const Address& fromAddress) |
878 |
const Address& fromAddress, |
|
|
879 |
const Address& toAddress) |
886 |
{ |
880 |
{ |
887 |
NS_LOG_FUNCTION (this << a << p << fromAddress); |
881 |
NS_LOG_FUNCTION (this << a << p << fromAddress); |
888 |
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> (); |
882 |
Ptr<Ipv4> ipv4 = m_node->GetObject<Ipv4> (); |
|
916 |
NS_LOG_LOGIC ("Cloned a TcpSocketImpl " << newSock); |
910 |
NS_LOG_LOGIC ("Cloned a TcpSocketImpl " << newSock); |
917 |
//this listening socket should do nothing more |
911 |
//this listening socket should do nothing more |
918 |
Simulator::ScheduleNow (&TcpSocketImpl::CompleteFork, newSock, |
912 |
Simulator::ScheduleNow (&TcpSocketImpl::CompleteFork, newSock, |
919 |
p, tcpHeader,fromAddress); |
913 |
p, tcpHeader,fromAddress, toAddress); |
920 |
return true; |
914 |
return true; |
921 |
} |
915 |
} |
922 |
// This is the cloned endpoint |
916 |
else |
923 |
m_endPoint->SetPeer (m_remoteAddress, m_remotePort); |
917 |
{// This is the cloned endpoint |
|
|
918 |
// TCP SYN consumes one byte |
919 |
m_nextRxSequence = tcpHeader.GetSequenceNumber() + SequenceNumber(1); |
920 |
SendEmptyPacket (TcpHeader::SYN | TcpHeader::ACK); |
921 |
} |
924 |
|
922 |
|
925 |
// Look up the source address |
|
|
926 |
if (ipv4->GetRoutingProtocol () != 0) |
927 |
{ |
928 |
Ipv4Header header; |
929 |
Socket::SocketErrno errno_; |
930 |
Ptr<Ipv4Route> route; |
931 |
uint32_t oif = 0; //specify non-zero if bound to a source address |
932 |
header.SetDestination (m_remoteAddress); |
933 |
route = ipv4->GetRoutingProtocol ()->RouteOutput (Ptr<Packet> (), header, oif, errno_); |
934 |
if (route != 0) |
935 |
{ |
936 |
NS_LOG_LOGIC ("Route exists"); |
937 |
m_endPoint->SetLocalAddress (route->GetSource ()); |
938 |
} |
939 |
else |
940 |
{ |
941 |
NS_LOG_ERROR (errno_); |
942 |
m_errno = errno_; |
943 |
return -1; |
944 |
} |
945 |
} |
946 |
else |
947 |
{ |
948 |
NS_FATAL_ERROR ("No Ipv4RoutingProtocol in the node"); |
949 |
} |
950 |
// TCP SYN consumes one byte |
951 |
m_nextRxSequence = tcpHeader.GetSequenceNumber() + SequenceNumber(1); |
952 |
SendEmptyPacket (TcpHeader::SYN | TcpHeader::ACK); |
953 |
break; |
923 |
break; |
954 |
case ACK_TX_1: |
924 |
case ACK_TX_1: |
955 |
NS_LOG_LOGIC ("TcpSocketImpl " << this <<" Action ACK_TX_1"); |
925 |
NS_LOG_LOGIC ("TcpSocketImpl " << this <<" Action ACK_TX_1"); |
|
982 |
NEW_SEQ_RX, |
952 |
NEW_SEQ_RX, |
983 |
p, |
953 |
p, |
984 |
tcpHeader, |
954 |
tcpHeader, |
985 |
fromAddress); |
955 |
fromAddress, |
|
|
956 |
toAddress); |
986 |
} |
957 |
} |
987 |
if (tcpHeader.GetAckNumber () < m_highestRxAck) //old ack, do nothing |
958 |
if (tcpHeader.GetAckNumber () < m_highestRxAck) //old ack, do nothing |
988 |
{ |
959 |
{ |
|
1006 |
break; |
977 |
break; |
1007 |
case NEW_SEQ_RX: |
978 |
case NEW_SEQ_RX: |
1008 |
NS_LOG_LOGIC ("TcpSocketImpl " << this <<" Action NEW_SEQ_RX"); |
979 |
NS_LOG_LOGIC ("TcpSocketImpl " << this <<" Action NEW_SEQ_RX"); |
1009 |
NewRx (p, tcpHeader, fromAddress); // Process new data received |
980 |
NewRx (p, tcpHeader, fromAddress, toAddress); // Process new data received |
1010 |
break; |
981 |
break; |
1011 |
case PEER_CLOSE: |
982 |
case PEER_CLOSE: |
1012 |
{ |
983 |
{ |
|
1020 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " setting pendingClose" |
991 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " setting pendingClose" |
1021 |
<< " rxseq " << tcpHeader.GetSequenceNumber () |
992 |
<< " rxseq " << tcpHeader.GetSequenceNumber () |
1022 |
<< " nextRxSeq " << m_nextRxSequence); |
993 |
<< " nextRxSeq " << m_nextRxSequence); |
1023 |
NewRx (p, tcpHeader, fromAddress); |
994 |
NewRx (p, tcpHeader, fromAddress, toAddress); |
1024 |
return true; |
995 |
return true; |
1025 |
} |
996 |
} |
1026 |
// Now we need to see if any data came with the FIN |
997 |
// Now we need to see if any data came with the FIN |
1027 |
// if so, call NewRx |
998 |
// if so, call NewRx |
1028 |
if (p->GetSize () != 0) |
999 |
if (p->GetSize () != 0) |
1029 |
{ |
1000 |
{ |
1030 |
NewRx (p, tcpHeader, fromAddress); |
1001 |
NewRx (p, tcpHeader, fromAddress, toAddress); |
1031 |
} |
1002 |
} |
1032 |
++m_nextRxSequence; //bump this to account for the FIN |
1003 |
++m_nextRxSequence; //bump this to account for the FIN |
1033 |
States_t saveState = m_state; // Used to see if app responds |
1004 |
States_t saveState = m_state; // Used to see if app responds |
|
1059 |
NS_LOG_LOGIC ("TcpSocketImpl " << this <<" Action SERV_NOTIFY"); |
1030 |
NS_LOG_LOGIC ("TcpSocketImpl " << this <<" Action SERV_NOTIFY"); |
1060 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " Connected!"); |
1031 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " Connected!"); |
1061 |
m_connected = true; // ! This is bogus; fix when we clone the tcp |
1032 |
m_connected = true; // ! This is bogus; fix when we clone the tcp |
1062 |
m_endPoint->SetPeer (m_remoteAddress, m_remotePort); |
1033 |
m_endPoint->SetPeer (m_endPoint->GetPeerAddress(), m_endPoint->GetPeerPort()); |
1063 |
//treat the connection orientation final ack as a newack |
1034 |
//treat the connection orientation final ack as a newack |
1064 |
CommonNewAck (tcpHeader.GetAckNumber (), true); |
1035 |
CommonNewAck (tcpHeader.GetAckNumber (), true); |
1065 |
NotifyNewConnectionCreated (this, fromAddress); |
1036 |
NotifyNewConnectionCreated (this, fromAddress); |
|
1070 |
return true; |
1041 |
return true; |
1071 |
} |
1042 |
} |
1072 |
|
1043 |
|
1073 |
void TcpSocketImpl::CompleteFork(Ptr<Packet> p, const TcpHeader& h, const Address& fromAddress) |
1044 |
void TcpSocketImpl::CompleteFork(Ptr<Packet> p, const TcpHeader& h, const Address& fromAddress, const Address& toAddress) |
1074 |
{ |
1045 |
{ |
1075 |
// Get port and address from peer (connecting host) |
1046 |
// Get port and address from peer (connecting host) |
1076 |
m_remotePort = InetSocketAddress::ConvertFrom (fromAddress).GetPort (); |
1047 |
m_endPoint = m_tcp->Allocate (InetSocketAddress::ConvertFrom(toAddress).GetIpv4 (), |
1077 |
m_remoteAddress = InetSocketAddress::ConvertFrom (fromAddress).GetIpv4 (); |
1048 |
InetSocketAddress::ConvertFrom(toAddress).GetPort (), |
1078 |
m_endPoint = m_tcp->Allocate (m_localAddress, |
1049 |
InetSocketAddress::ConvertFrom (fromAddress).GetIpv4 (), |
1079 |
m_localPort, |
1050 |
InetSocketAddress::ConvertFrom (fromAddress).GetPort ()); |
1080 |
m_remoteAddress, |
|
|
1081 |
m_remotePort); |
1082 |
//the cloned socket with be in listen state, so manually change state |
1051 |
//the cloned socket with be in listen state, so manually change state |
1083 |
m_state = SYN_RCVD; |
1052 |
m_state = SYN_RCVD; |
1084 |
//equivalent to FinishBind |
1053 |
//equivalent to FinishBind |
1085 |
m_endPoint->SetRxCallback (MakeCallback (&TcpSocketImpl::ForwardUp, Ptr<TcpSocketImpl>(this))); |
1054 |
m_endPoint->SetRxCallback (MakeCallback (&TcpSocketImpl::ForwardUp, Ptr<TcpSocketImpl>(this))); |
1086 |
m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketImpl::Destroy, Ptr<TcpSocketImpl>(this))); |
1055 |
m_endPoint->SetDestroyCallback (MakeCallback (&TcpSocketImpl::Destroy, Ptr<TcpSocketImpl>(this))); |
1087 |
ProcessPacketAction(SYN_ACK_TX, p, h, fromAddress); |
1056 |
ProcessPacketAction(SYN_ACK_TX, p, h, fromAddress, toAddress); |
1088 |
} |
1057 |
} |
1089 |
|
1058 |
|
1090 |
void TcpSocketImpl::ConnectionSucceeded() |
1059 |
void TcpSocketImpl::ConnectionSucceeded() |
|
1146 |
header.SetSequenceNumber (m_nextTxSequence); |
1115 |
header.SetSequenceNumber (m_nextTxSequence); |
1147 |
header.SetAckNumber (m_nextRxSequence); |
1116 |
header.SetAckNumber (m_nextRxSequence); |
1148 |
header.SetSourcePort (m_endPoint->GetLocalPort()); |
1117 |
header.SetSourcePort (m_endPoint->GetLocalPort()); |
1149 |
header.SetDestinationPort (m_remotePort); |
1118 |
header.SetDestinationPort (m_endPoint->GetPeerPort()); |
1150 |
header.SetWindowSize (AdvertisedWindowSize()); |
1119 |
header.SetWindowSize (AdvertisedWindowSize()); |
1151 |
if (m_shutdownSend) |
1120 |
if (m_shutdownSend) |
1152 |
{ |
1121 |
{ |
|
1166 |
NS_LOG_LOGIC ("About to send a packet with flags: " << flags); |
1135 |
NS_LOG_LOGIC ("About to send a packet with flags: " << flags); |
1167 |
m_tcp->SendPacket (p, header, |
1136 |
m_tcp->SendPacket (p, header, |
1168 |
m_endPoint->GetLocalAddress (), |
1137 |
m_endPoint->GetLocalAddress (), |
1169 |
m_remoteAddress); |
1138 |
m_endPoint->GetPeerAddress()); |
1170 |
m_rtt->SentSeq(m_nextTxSequence, sz); // notify the RTT |
1139 |
m_rtt->SentSeq(m_nextTxSequence, sz); // notify the RTT |
1171 |
// Notify the application of the data being sent |
1140 |
// Notify the application of the data being sent |
1172 |
Simulator::ScheduleNow(&TcpSocketImpl::NotifyDataSent, this, sz); |
1141 |
Simulator::ScheduleNow(&TcpSocketImpl::NotifyDataSent, this, sz); |
|
1224 |
|
1193 |
|
1225 |
void TcpSocketImpl::NewRx (Ptr<Packet> p, |
1194 |
void TcpSocketImpl::NewRx (Ptr<Packet> p, |
1226 |
const TcpHeader& tcpHeader, |
1195 |
const TcpHeader& tcpHeader, |
1227 |
const Address& fromAddress) |
1196 |
const Address& fromAddress, |
|
|
1197 |
const Address& toAddress) |
1228 |
{ |
1198 |
{ |
1229 |
NS_LOG_FUNCTION (this << p << "tcpHeader " << fromAddress); |
1199 |
NS_LOG_FUNCTION (this << p << "tcpHeader " << fromAddress); |
1230 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " NewRx," |
1200 |
NS_LOG_LOGIC ("TcpSocketImpl " << this << " NewRx," |
|
1291 |
{ // See if we can close now |
1261 |
{ // See if we can close now |
1292 |
if (m_bufferedData.empty()) |
1262 |
if (m_bufferedData.empty()) |
1293 |
{ |
1263 |
{ |
1294 |
ProcessPacketAction (PEER_CLOSE, p, tcpHeader, fromAddress); |
1264 |
ProcessPacketAction (PEER_CLOSE, p, tcpHeader, fromAddress, toAddress); |
1295 |
} |
1265 |
} |
1296 |
} |
1266 |
} |
1297 |
} |
1267 |
} |
|
1608 |
tcpHeader.SetSequenceNumber (m_nextTxSequence); |
1578 |
tcpHeader.SetSequenceNumber (m_nextTxSequence); |
1609 |
tcpHeader.SetAckNumber (m_nextRxSequence); |
1579 |
tcpHeader.SetAckNumber (m_nextRxSequence); |
1610 |
tcpHeader.SetSourcePort (m_endPoint->GetLocalPort()); |
1580 |
tcpHeader.SetSourcePort (m_endPoint->GetLocalPort()); |
1611 |
tcpHeader.SetDestinationPort (m_remotePort); |
1581 |
tcpHeader.SetDestinationPort (m_endPoint->GetPeerPort()); |
1612 |
tcpHeader.SetWindowSize (AdvertisedWindowSize()); |
1582 |
tcpHeader.SetWindowSize (AdvertisedWindowSize()); |
1613 |
|
1583 |
|
1614 |
m_tcp->SendPacket (p, tcpHeader, m_endPoint->GetLocalAddress (), |
1584 |
m_tcp->SendPacket (p, tcpHeader, m_endPoint->GetLocalAddress (), |
1615 |
m_remoteAddress); |
1585 |
m_endPoint->GetPeerAddress()); |
1616 |
NS_LOG_LOGIC ("Schedule persist timeout at time " |
1586 |
NS_LOG_LOGIC ("Schedule persist timeout at time " |
1617 |
<<Simulator::Now ().GetSeconds () << " to expire at time " |
1587 |
<<Simulator::Now ().GetSeconds () << " to expire at time " |
1618 |
<< (Simulator::Now () + m_persistTime).GetSeconds()); |
1588 |
<< (Simulator::Now () + m_persistTime).GetSeconds()); |
|
1673 |
tcpHeader.SetSequenceNumber (m_nextTxSequence); |
1643 |
tcpHeader.SetSequenceNumber (m_nextTxSequence); |
1674 |
tcpHeader.SetAckNumber (m_nextRxSequence); |
1644 |
tcpHeader.SetAckNumber (m_nextRxSequence); |
1675 |
tcpHeader.SetSourcePort (m_endPoint->GetLocalPort()); |
1645 |
tcpHeader.SetSourcePort (m_endPoint->GetLocalPort()); |
1676 |
tcpHeader.SetDestinationPort (m_remotePort); |
1646 |
tcpHeader.SetDestinationPort (m_endPoint->GetPeerPort()); |
1677 |
tcpHeader.SetFlags (flags); |
1647 |
tcpHeader.SetFlags (flags); |
1678 |
tcpHeader.SetWindowSize (AdvertisedWindowSize()); |
1648 |
tcpHeader.SetWindowSize (AdvertisedWindowSize()); |
1679 |
|
1649 |
|
1680 |
m_tcp->SendPacket (p, tcpHeader, m_endPoint->GetLocalAddress (), |
1650 |
m_tcp->SendPacket (p, tcpHeader, m_endPoint->GetLocalAddress (), |
1681 |
m_remoteAddress); |
1651 |
m_endPoint->GetPeerAddress()); |
1682 |
} |
1652 |
} |
1683 |
|
1653 |
|
1684 |
void |
1654 |
void |