IPアドレス
IPアドレス
読み方:アイピーアドレス
【英】IP address
IPアドレスとは、インターネットやイントラネットなどのTCP/IPプロトコルを利用したネットワークにおける識別番号のことである。ネットワークに接続された個々のコンピュータに割り振られる。
現在のインターネットで用いられているIPv4では、8ビットずつ4つに区切られた32ビットの数値が使われており、0から255までの10進数の数字が4つ並べて表される。なお、ネットワーク上では、同じIPアドレスが存在することは許されていないため、国際的な管理組織であるNICによって一元的に管理されている。また、日本においては、JPNICが管理を行っている。
IPアドレスは、数値が並んでいるだけのものであるため、DNSというシステムを用いることで、IPアドレスに名称(ドメイン名)を付けることも可能である。
現在のIPv4では、42億9496万7296台のIPアドレスまでしか表すことができないため、IPアドレス資源の枯渇が問題となっているが、後継バージョンのIPv6では、約3.4×10の38乗個のIPアドレスを表すことができ、実質的には、ほぼ無限大にまで拡大されている。これにより、パソコンだけでなく家電や車など、あらゆる身の回りのもの全てにIPアドレスを割り当てることも可能になるといわれている。
IPAddress クラス
アセンブリ: System (system.dll 内)
構文
解説
使用例
サーバーに問い合わせて、ファミリ アドレスおよびそのサーバーがサポートする IP アドレスを取得する方法を次の例に示します。
' This program shows how to use the IPAddress class to obtain a server ' IP addressess and related information. Imports System Imports System.Net Imports System.Net.Sockets Imports System.Text.RegularExpressions Imports Microsoft.VisualBasic Namespace Mssc.Services.ConnectionManagement Module M_TestIPAddress Class TestIPAddress 'The IPAddresses method obtains the selected server IP address information. 'It then displays the type of address family supported by the server and 'its IP address in standard and byte format. Private Shared Sub IPAddresses(ByVal server As String) Try Dim ASCII As New System.Text.ASCIIEncoding() ' Get server related information. Dim heserver As IPHostEntry = Dns.Resolve(server) ' Loop on the AddressList Dim curAdd As IPAddress For Each curAdd In heserver.AddressList ' Display the type of address family supported by the server. If the ' server is IPv6-enabled this value is: InternNetworkV6. If the server ' is also IPv4-enabled there will be an additional value of InterNetwork. Console.WriteLine(("AddressFamily: " + curAdd.AddressFamily.ToString())) ' Display the ScopeId property in case of IPV6 addresses. If curAdd.AddressFamily.ToString() = ProtocolFamily.InterNetworkV6.ToString() Then Console.WriteLine(("Scope Id: " + curAdd.ScopeId.ToString())) End If ' Display the server IP address in the standard format. In ' IPv4 the format will be dotted-quad notation, in IPv6 it will be ' in in colon-hexadecimal notation. Console.WriteLine(("Address: " + curAdd.ToString())) ' Display the server IP address in byte format. Console.Write("AddressBytes: ") Dim bytes As [Byte]() = curAdd.GetAddressBytes() Dim i As Integer For i = 0 To bytes.Length - 1 Console.Write(bytes(i)) Next i Console.WriteLine(ControlChars.Cr + ControlChars.Lf) Next curAdd Catch e As Exception Console.WriteLine(("[DoResolve] Exception: " + e.ToString())) End Try End Sub 'IPAddresses ' This IPAddressAdditionalInfo displays additional server address information. Private Shared Sub IPAddressAdditionalInfo() Try ' Display the flags that show if the server supports IPv4 or IPv6 ' address schemas. Console.WriteLine((ControlChars.Cr + ControlChars.Lf + "SupportsIPv4: " + Socket.SupportsIPv4.ToString())) Console.WriteLine(("SupportsIPv6: " + Socket.SupportsIPv6.ToString())) If Socket.SupportsIPv6 Then ' Display the server Any address. This IP address indicates that the server ' should listen for client activity on all network interfaces. Console.WriteLine((ControlChars.Cr + ControlChars.Lf + "IPv6Any: " + IPAddress.IPv6Any.ToString())) ' Display the server loopback address. Console.WriteLine(("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString())) ' Used during autoconfiguration first phase. Console.WriteLine(("IPv6None: " + IPAddress.IPv6None.ToString())) Console.WriteLine(("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback).ToString())) End If Console.WriteLine(("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback).ToString())) Catch e As Exception Console.WriteLine(("[IPAddresses] Exception: " + e.ToString())) End Try End Sub 'IPAddressAdditionalInfo Public Shared Sub Main(ByVal args() As String) Dim server As String = Nothing ' Define a regular expression to parse user's input. ' This is a security check. It allows only ' alphanumeric input string between 2 to 40 character long. 'Define a regular expression to parse user's input. 'This is a security check. It allows only 'alphanumeric input string between 2 to 40 character long. Dim rex As New Regex("^[a-zA-Z]\w{1 ,39}$") If args.Length < 1 Then ' If no server name is passed as an argument to this program, use the current ' server name as default. server = Dns.GetHostName() Console.WriteLine(("Using current host: " + server)) Else server = args(0) If Not rex.Match(server).Success Then Console.WriteLine("Input string format not allowed.") Return End If End If ' Get the list of the addresses associated with the requested server. IPAddresses(server) ' Get additonal address information. IPAddressAdditionalInfo() End Sub 'Main End Class 'TestIPAddress End Module End Namespace
// This program shows how to use the IPAddress class to obtain a server // IP addressess and related information. using System; using System.Net; using System.Net.Sockets; using System.Text.RegularExpressions; namespace Mssc.Services.ConnectionManagement { class TestIPAddress { /** * The IPAddresses method obtains the selected server IP address information. * It then displays the type of address family supported by the server and its * IP address in standard and byte format. **/ private static void IPAddresses(string server) { try { System.Text.ASCIIEncoding ASCII = new System.Text.ASCIIEncoding(); // Get server related information. IPHostEntry heserver = Dns.Resolve(server); // Loop on the AddressList foreach (IPAddress curAdd in heserver.AddressList) { // Display the type of address family supported by the server. If the // server is IPv6-enabled this value is: InternNetworkV6. If the server // is also IPv4-enabled there will be an additional value of InterNetwork. Console.WriteLine("AddressFamily: " + curAdd.AddressFamily.ToString()); // Display the ScopeId property in case of IPV6 addresses. if(curAdd.AddressFamily.ToString() == ProtocolFamily.InterNetworkV6.ToString()) Console.WriteLine("Scope Id: " + curAdd.ScopeId.ToString()); // Display the server IP address in the standard format. In // IPv4 the format will be dotted-quad notation, in IPv6 it will be // in in colon-hexadecimal notation. Console.WriteLine("Address: " + curAdd.ToString()); // Display the server IP address in byte format. Console.Write("AddressBytes: "); Byte[] bytes = curAdd.GetAddressBytes(); for (int i = 0; i < bytes.Length; i++) { Console.Write(bytes[i]); } Console.WriteLine("\r\n"); } } catch (Exception e) { Console.WriteLine("[DoResolve] Exception: " + e.ToString()); } } // This IPAddressAdditionalInfo displays additional server address information. private static void IPAddressAdditionalInfo() { try { // Display the flags that show if the server supports IPv4 or IPv6 // address schemas. Console.WriteLine("\r\nSupportsIPv4: " + Socket.SupportsIPv4); Console.WriteLine("SupportsIPv6: " + Socket.SupportsIPv6); if (Socket.SupportsIPv6) { // Display the server Any address. This IP address indicates that the server // should listen for client activity on all network interfaces. Console.WriteLine("\r\nIPv6Any: " + IPAddress.IPv6Any.ToString()); // Display the server loopback address. Console.WriteLine("IPv6Loopback: " + IPAddress.IPv6Loopback.ToString()); // Used during autoconfiguration first phase. Console.WriteLine("IPv6None: " + IPAddress.IPv6None.ToString()); Console.WriteLine("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback)); } Console.WriteLine("IsLoopback(Loopback): " + IPAddress.IsLoopback(IPAddress.Loopback)); } catch (Exception e) { Console.WriteLine("[IPAddresses] Exception: " + e.ToString()); } } public static void Main(string[] args) { string server = null; // Define a regular expression to parse user's input. // This is a security check. It allows only // alphanumeric input string between 2 to 40 character long. Regex rex = new Regex(@"^[a-zA-Z]\w{1,39}$"); if (args.Length < 1) { // If no server name is passed as an argument to this program, use the current // server name as default. server = Dns.GetHostName(); Console.WriteLine("Using current host: " + server); } else { server = args[0]; if (!(rex.Match(server)).Success) { Console.WriteLine("Input string format not allowed."); return; } } // Get the list of the addresses associated with the requested server. IPAddresses(server); // Get additonal address information. IPAddressAdditionalInfo(); } } }
// This program shows how to use the IPAddress class to obtain a server // IP addressess and related information. import System.*; import System.Net.*; import System.Net.Sockets.*; import System.Text.RegularExpressions.*; class TestIPAddress { /** The IPAddresses method obtains the selected server IP address information.It then displays the type of address family supported by the server and its IP address in standard and byte format. */ private static void IPAddresses(String server) { try { System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding(); // Get server related information. IPHostEntry heserver = Dns.Resolve(server); // Loop on the AddressList for (int iCtr = 0; iCtr < heserver.get_AddressList().length; iCtr++) { IPAddress curAdd = heserver.get_AddressList()[iCtr]; // Display the type of address family supported by the server. // If the server is IPv6-enabled this value is:InternNetworkV6. // If the server is also IPv4-enabled there will be an // additional value of InterNetwork. Console.WriteLine(("AddressFamily: " + curAdd.get_AddressFamily().ToString())); // Display the ScopeId property in case of IPV6 addresses. if (curAdd.get_AddressFamily().ToString().equals( ProtocolFamily.InterNetworkV6.ToString())) { Console.WriteLine(("Scope Id: " +(new Long(curAdd.get_ScopeId())).ToString())); } // Display the server IP address in the standard format. In // IPv4 the format will be dotted-quad notation, in IPv6 // it will be in in colon-hexadecimal notation. Console.WriteLine(("Address: " + curAdd.ToString())); // Display the server IP address in byte format. Console.Write("AddressBytes: "); ubyte bytes[] = curAdd.GetAddressBytes(); for (int i = 0; i < bytes.length; i++) { Console.Write(bytes[i]); } Console.WriteLine("\r\n"); } } catch (System.Exception e) { Console.WriteLine(("[DoResolve] Exception: " + e.ToString())); } } //IPAddresses // This IPAddressAdditionalInfo displays additional server address // information. private static void IPAddressAdditionalInfo() { try { // Display the flags that show if the server supports IPv4 or IPv6 // address schemas. Console.WriteLine("\r\nSupportsIPv4: " + System.Convert.ToString(Socket.get_SupportsIPv4())); Console.WriteLine("SupportsIPv6: " + System.Convert.ToString(Socket.get_SupportsIPv6())); if (Socket.get_SupportsIPv6()) { // Display the server Any address. This IP address indicates // that the server should listen for client activity on all // network interfaces. Console.WriteLine(("\r\nIPv6Any: " + (IPAddress.IPv6Any).ToString())); // Display the server loopback address. Console.WriteLine(("IPv6Loopback: " + (IPAddress.IPv6Loopback).ToString())); // Used during autoconfiguration first phase. Console.WriteLine(("IPv6None: " + (IPAddress.IPv6None).ToString())); Console.WriteLine(("IsLoopback(IPv6Loopback): " + IPAddress.IsLoopback(IPAddress.IPv6Loopback))); } Console.WriteLine(("IsLoopback(Loopback): " + System.Convert.ToString(IPAddress. IsLoopback(IPAddress.Loopback)))); } catch (System.Exception e) { Console.WriteLine(("[IPAddresses] Exception: " + e.ToString())); } } //IPAddressAdditionalInfo public static void main(String[] args) { String server = null; // Define a regular expression to parse user's input. // This is a security check. It allows only // alphanumeric input string between 2 to 40 character long. Regex rex = new Regex("^[a-zA-Z]\\w{1,39}$"); if (args.length < 1) { // If no server name is passed as an argument to this program, // use the current server name as default. server = Dns.GetHostName(); Console.WriteLine(("Using current host: " + server)); } else { server = args[0]; if (!(rex.Match(server).get_Success())) { Console.WriteLine("Input string format not allowed."); return; } } // Get the list of the addresses associated with the requested server. IPAddresses(server); // Get additonal address information. IPAddressAdditionalInfo(); } //main } //TestIPAddress
System.Net.IPAddress
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
IPAddress コンストラクタ (Int64)
アセンブリ: System (system.dll 内)
構文
解説
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
IPAddress コンストラクタ (Byte[], Int64)
アセンブリ: System (system.dll 内)
構文
例外
このコンストラクタは IPv6 アドレスをインスタンス化します。scopeid は、リンクローカル アドレスの場合にネットワーク インターフェイスを識別します。スコープは、リンクローカル アドレスおよびサイトローカル アドレスの場合にだけ有効です。
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
IPAddress コンストラクタ
オーバーロードの一覧
名前 | 説明 |
---|---|
IPAddress (Byte[]) | Byte 配列として指定されたアドレスを使用して、IPAddress クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
IPAddress (Int64) | Int64 として指定されたアドレスを使用して、IPAddress クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
IPAddress (Byte[], Int64) | 指定したアドレスとスコープを使用して、IPAddress クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
IPAddress コンストラクタ (Byte[])
アセンブリ: System (system.dll 内)
構文
例外
解説
IPAddress が、Address プロパティが address に設定された状態で作成されます。
address の長さが 4 の場合は、IPAddress(Byte[]) が IPv4 アドレスを作成します。それ以外の場合は、スコープが 0 の IPv6 アドレスが作成されます。
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
IPAddress フィールド
IPAddress プロパティ
IPAddress メソッド
パブリック メソッド
名前 | 説明 | |
---|---|---|
Equals | オーバーロードされます。 オーバーライドされます。 | |
GetAddressBytes | IPAddress のコピーをバイト配列として提供します。 | |
GetHashCode | オーバーライドされます。 IP アドレスのハッシュ値を返します。 | |
GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) | |
HostToNetworkOrder | オーバーロードされます。 値をホストのバイト順からネットワークのバイト順に変換します。 | |
IsLoopback | 指定した IP アドレスがループバック アドレスかどうかを示します。 | |
NetworkToHostOrder | オーバーロードされます。 数値をネットワークのバイト順からホストのバイト順に変換します。 | |
Parse | IP アドレス文字列を IPAddress インスタンスに変換します。 | |
ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) | |
ToString | オーバーライドされます。 インターネット アドレスを標準表記に変換します。 | |
TryParse | 文字列が有効な IP アドレスであるかどうかを判断します。 |
名前 | 説明 | |
---|---|---|
Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) | |
MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
IPAddress メンバ
インターネット プロトコル (IP: Internet Protocol) アドレスを提供します。
IPAddress データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック フィールド
パブリック プロパティ
パブリック メソッド
名前 | 説明 | |
---|---|---|
Equals | オーバーロードされます。 オーバーライドされます。 | |
GetAddressBytes | IPAddress のコピーをバイト配列として提供します。 | |
GetHashCode | オーバーライドされます。 IP アドレスのハッシュ値を返します。 | |
GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) | |
HostToNetworkOrder | オーバーロードされます。 値をホストのバイト順からネットワークのバイト順に変換します。 | |
IsLoopback | 指定した IP アドレスがループバック アドレスかどうかを示します。 | |
NetworkToHostOrder | オーバーロードされます。 数値をネットワークのバイト順からホストのバイト順に変換します。 | |
Parse | IP アドレス文字列を IPAddress インスタンスに変換します。 | |
ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) | |
ToString | オーバーライドされます。 インターネット アドレスを標準表記に変換します。 | |
TryParse | 文字列が有効な IP アドレスであるかどうかを判断します。 |
名前 | 説明 | |
---|---|---|
Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) | |
MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
IPアドレス
(IP address から転送)
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2024/01/30 04:42 UTC 版)
IPアドレス(アイピーアドレス、英: IP address)は、Internet Protocol(IP)で通信相手を識別するための番号である。インターネットアドレスとも呼ばれる[1][2]。
注釈
出典
- ^ TR X 0055:2002 インターネット利用者のための用語
- ^ 『IPアドレス』 - コトバンク
- ^ WHATWG (2017年7月30日). “URL Standard 3.5. Host parsing” (英語). 2017年7月30日閲覧。
- ^ “26431 – Define IPv4 parsing” (英語). W3C (2015年7月1日). 2017年7月30日閲覧。
- ^ 日本ケーブルラボ事務局山下良蔵 (2009年10月21日). “IPv4アドレス在庫枯渇対応に関する広報戦略ワーキンググループ(第4回)配布資料 資料WG広4-2 ケーブルテレビ業界のIPv4アドレス枯渇対応とIPv6化” (PDF). 総務省. p. 15. 2017年11月26日閲覧。
- ^ 「インターネット用語1分解説 - 割り振り (Allocation)、割り当て (Assignment) とは」『JPNIC News & Views』8巻(2002年1月15日)、日本ネットワークインフォメーションセンター。
- ^ “LACNIC Announces the Start of the Final Phase of IPv4 Exhaustion”. LACNIC (2017年2月15日). 2017年11月19日閲覧。
「IP address」の例文・使い方・用例・文例
- データの通信や交換を容易にするためにTCP/IPネットワークプロトコルを用いた、世界的に広がったネットワークから成るコンピュータネットワーク
- 4MIPSは一秒間に4,000,000インストラクションである
- リンケージサービスという,キャプテンで特定のIPから関連のIP情報を検索するサービス
- アル・ゴア氏とIPCCがノーベル平和賞を共同受賞
- 2007年のノーベル平和賞は,前米国副大統領のアル・ゴア氏と国連の気候変動に関する政府間パネル(IPCC)が共同で受賞した。
- IPCCは気候変動に関する世界有数の専門機関だ。
- 100か国以上の何千人もの科学者たちがIPCCのために科学報告書の作成に取り組んでいる。
- ノーベル賞委員会は,IPCCが過去20年間にわたり,その報告書によって,人間の活動と地球温暖化の関係をより明確にしてきたと考えた。
- IPCCのラジェンドラ・パチャウリ議長は,「この賞によって,このテーマが脚光を浴(あ)び,認識がさらに高まって危機感が生まれることを期待する。」と話した。
- グーグルは2004年に新規株式公開(IPO)で19億ドルを調達したが,フェイスブックは50億ドル(3800億円)を調達する見込みだ。
- それはインターネット関連企業としては史上最大のIPOとなる。
- IP addressのページへのリンク